summaryrefslogtreecommitdiff
path: root/java/tests/SOCK_SAP/SOCKConnectorTest.java
diff options
context:
space:
mode:
authornobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-01-01 08:00:34 +0000
committernobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-01-01 08:00:34 +0000
commit437eea6fa08e931864f89be91d14a816f69075c7 (patch)
treeb8c1fd723fdcd61c3855d3a3a21a9cd45a268219 /java/tests/SOCK_SAP/SOCKConnectorTest.java
parentea0d28240863caf437a18071bfd03e7b146c5ade (diff)
downloadATCD-unlabeled-4.2.2.tar.gz
This commit was manufactured by cvs2svn to create branchunlabeled-4.2.2
'unlabeled-4.2.2'.
Diffstat (limited to 'java/tests/SOCK_SAP/SOCKConnectorTest.java')
-rw-r--r--java/tests/SOCK_SAP/SOCKConnectorTest.java86
1 files changed, 0 insertions, 86 deletions
diff --git a/java/tests/SOCK_SAP/SOCKConnectorTest.java b/java/tests/SOCK_SAP/SOCKConnectorTest.java
deleted file mode 100644
index f9d135753f2..00000000000
--- a/java/tests/SOCK_SAP/SOCKConnectorTest.java
+++ /dev/null
@@ -1,86 +0,0 @@
-// ============================================================================
-//
-// = PACKAGE
-// tests.SOCK_SAP
-//
-// = FILENAME
-// SOCKConnectorTest.java
-//
-// = AUTHOR
-// Prashant Jain
-//
-// ============================================================================
-package tests.SOCK_SAP;
-
-import java.io.*;
-import java.net.*;
-import ACE.OS.*;
-import ACE.SOCK_SAP.*;
-
-public class SOCKConnectorTest
-{
- void print_usage_and_die ()
- {
- System.out.println ("Usage: SOCKConnectorTest <hostname> [<port>]");
- System.exit (0);
- }
-
- void processRequests (SOCKStream stream) throws IOException
- {
- DataInputStream in = new DataInputStream (System.in);
- String msg;
- int ack_len;
-
- while (true)
- {
- StringBuffer ack = new StringBuffer ();
- ACE.DEBUG ("Enter input: ");
- ACE.FLUSH ();
- msg = in.readLine ();
- if (msg == null)
- break;
- stream.send (msg);
- ACE.DEBUG ("Waiting for ack...");
- ack_len = stream.recv (ack);
- if (ack_len == 0)
- break;
- else
- ACE.DEBUG (ack.toString ());
- }
- }
-
- public void init (String host, int port)
- {
- SOCKStream stream = new SOCKStream ();
- SOCKConnector connector = new SOCKConnector ();
- try
- {
- connector.connect (stream,
- host,
- port);
- processRequests (stream);
- }
- catch (IOException e)
- {
- ACE.ERROR (e);
- }
- }
-
- public static void main (String [] args)
- {
- int port = ACE.DEFAULT_SERVER_PORT;
- SOCKConnectorTest client = new SOCKConnectorTest ();
- if (args.length == 2)
- {
- try
- {
- port = Integer.parseInt (args[1]);
- }
- catch (NumberFormatException e)
- {
- client.print_usage_and_die ();
- }
- }
- client.init (args[0], port);
- }
-}