diff options
author | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1996-12-30 06:50:29 +0000 |
---|---|---|
committer | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1996-12-30 06:50:29 +0000 |
commit | a4a7690c336d4c8a16b3041c86d501ba38226e96 (patch) | |
tree | 9e9f93a98edd2591453f092d178ad29a1c5fb519 /java/src/SOCKAcceptor.java | |
parent | a5c4d8047ab58df5c45092e18ae503ad40518f0e (diff) | |
download | ATCD-unlabeled-4.1.2.tar.gz |
This commit was manufactured by cvs2svn to create branchunlabeled-4.1.2
'unlabeled-4.1.2'.
Diffstat (limited to 'java/src/SOCKAcceptor.java')
-rw-r--r-- | java/src/SOCKAcceptor.java | 114 |
1 files changed, 0 insertions, 114 deletions
diff --git a/java/src/SOCKAcceptor.java b/java/src/SOCKAcceptor.java deleted file mode 100644 index a8e8f6d0994..00000000000 --- a/java/src/SOCKAcceptor.java +++ /dev/null @@ -1,114 +0,0 @@ -/************************************************* - * - * = PACKAGE - * ACE.SOCK_SAP - * - * = FILENAME - * SOCKAcceptor.java - * - *@author Prashant Jain - * - *************************************************/ -package ACE.SOCK_SAP; - -import java.io.*; -import java.net.*; -import ACE.OS.*; - -/** - * <hr> - * <p><b>TITLE</b><br> - * Defines the format and interface for an ACE.SOCKAcceptor. - */ -public class SOCKAcceptor -{ - // = Initialization - - /** - * Create a SOCKAcceptor. Do nothing constructor. Allows user to - * call open() later and pass in the port number. - */ - public SOCKAcceptor () - { - } - - /** - * Create a SOCKAcceptor. - *@param port port number where the server will listen for connections - */ - public SOCKAcceptor (int port) throws IOException - { - this.open (port); - } - - /** - * Create socket to listen for connections on. - *@param port port number where the server will listen for connections - */ - public void open(int port) throws IOException - { - // Close old socket (if there is one) - this.close (); - - // Create a new server socket - this.listenSocket_ = new ServerSocket (port); - // ACE.DEBUG ("Server listening on port " + port); - } - - /** - * Close the socket and do any necessary cleanup. - */ - public void close () throws IOException - { - if (this.listenSocket_ != null) - { - this.listenSocket_.close (); - this.listenSocket_ = null; - } - } - - /** - * Accept a connection. The streams are set when the method returns. - *@param sockStream SOCK Stream to use for the connection - */ - public void accept (SOCKStream sockStream) throws SocketException, IOException - { - // Block in accept. Returns when a connection shows up and sets - // the streams - sockStream.socket (this.listenSocket_.accept ()); - ACE.DEBUG ("Accepted connection from " + - sockStream.socket ().getInetAddress ()); - } - - /** - * Get the underlying listen socket. - *@return the underlying listen socket - */ - public ServerSocket listenSocket () - { - return this.listenSocket_; - } - - /** - * Set the underlying listen socket. - *@param s the underlying listen socket - */ - public void listenSocket (ServerSocket s) - { - this.listenSocket_ = s; - } - - /** - * Clean up when the garbage collector gets run (if at all). Note - * that there is no guarantee that finalize () will get called. - */ - protected void finalize () throws Throwable - { - super.finalize (); - this.close (); - } - - // Socket on which listen for connections (by default initialized to - // null) - private ServerSocket listenSocket_; -} |