diff options
author | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-03-07 16:30:11 +0000 |
---|---|---|
committer | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-03-07 16:30:11 +0000 |
commit | a980eaccb9f0338f262549f31cc99a23529efd73 (patch) | |
tree | 726d1a64fda6757c5c37b41a489af40bcfa7505c /java/JACE/tests/netsvcs/Logger/LoggerTest.java | |
parent | dcd83bbd125e03d0659576ba51831a7350e3fd49 (diff) | |
download | ATCD-a980eaccb9f0338f262549f31cc99a23529efd73.tar.gz |
This commit was manufactured by cvs2svn to create tag 'TAO-1_0_15'.TAO-1_0_15
Diffstat (limited to 'java/JACE/tests/netsvcs/Logger/LoggerTest.java')
-rw-r--r-- | java/JACE/tests/netsvcs/Logger/LoggerTest.java | 115 |
1 files changed, 0 insertions, 115 deletions
diff --git a/java/JACE/tests/netsvcs/Logger/LoggerTest.java b/java/JACE/tests/netsvcs/Logger/LoggerTest.java deleted file mode 100644 index ae835b07753..00000000000 --- a/java/JACE/tests/netsvcs/Logger/LoggerTest.java +++ /dev/null @@ -1,115 +0,0 @@ -/************************************************* - * - * = FILENAME - * LoggerTest.java - * - *@author Everett Anderson - * - *************************************************/ -package JACE.tests.netsvcs.Logger; - -import JACE.SOCK_SAP.*; -import java.io.*; -import java.net.*; -import JACE.OS.*; -import JACE.netsvcs.Logger.*; - -/** - * - * This is a simple test log client very similar to the direct_logging - * client of C++ ACE. The logging service should correctly receive - * messages from both the C++ and Java version. - * - * @see JACE.netsvcs.Logger.ServerLoggingAcceptor - */ -public class LoggerTest { - - /** Command line: <hostname> [<port>] - * - * Creates a "hello world" log message and sends it to the server logging - * service. - */ - public static void main(String args[]) - { - if (args.length != 2) { - System.err.println("Use: LoggerTest <host name> [<port>]"); - System.exit(0); - } - - ACE.enableDebugging (); - - // Set the port - int port = args.length > 1 ? - (new Integer(args[1])).intValue() : ACE.DEFAULT_SERVER_PORT; - - SOCKStream cli_stream = new SOCKStream(); - INETAddr remote_addr; - String host; - - // Try to find the host - try { - - host = args[0]; - - remote_addr = new INETAddr(port, host); - - } catch (UnknownHostException uhe) { - ACE.ERROR("UnknownHostException " + uhe); - return; - } - - System.out.println("Connecting to " + host + " on port " + port); - - SOCKConnector con = new SOCKConnector(); - - try { - - // Connect to the service - con.connect(cli_stream, remote_addr); - - } catch (SocketException se) { - - ACE.ERROR("Socket Exception " + se); - return; - - } catch (IOException ie) { - - ACE.ERROR("IOException " + ie); - return; - } - - - // Send a message with priority 4, the current time, - // and 0 for the process ID. - LogRecord record = new LogRecord(4, - System.currentTimeMillis(), - 0); - - // Set the text of the message - record.msgData("hello world"); - - try { - - // Send it - record.streamOutTo(cli_stream.socket().getOutputStream ()); - - // Close the socket - cli_stream.close(); - - } catch (IOException ie) { - - ACE.ERROR("" + ie); - return; - } - } -}; - - - - - - - - - - |