Main Page | Packages | Class Hierarchy | Class List | Directories | File List | Class Members

seda.nbio.NonblockingServerSocket Class Reference

Inherits seda.nbio.Selectable.

List of all members.


Detailed Description

A NonblockingServerSocket implements a nonblocking variant of java.net.ServerSocket.

(Ideally it would simply extend the latter class, but ServerSocket does not contain an appropriate public constructor which would make that feasible.)

See also:
java.net.ServerSocket


Public Member Functions

 NonblockingServerSocket (int port) throws IOException
 Create a nonblocking server socket listening on the given port.
 NonblockingServerSocket (int port, int backlog) throws IOException
 Create a nonblocking server socket listening on the given port with the given connection backlog (the default is 511).
 NonblockingServerSocket (int port, int backlog, InetAddress bindAddr) throws IOException
 Create a nonblocking server socket listening on the given port, with the given connection backlog, bound to the given address.
NonblockingSocket accept () throws IOException
 Accept a connection on this server socket.
synchronized NonblockingSocket nbAccept () throws IOException
 Perform a nonblocking accept() on this socket.
InetAddress getInetAddress ()
 Return the address to which this socket is bound.
int getLocalPort ()
 Return the port to which this socket is bound.
synchronized void setSoTimeout (int timeout) throws SocketException
 Currently unimplemented.
synchronized int getSoTimeout () throws SocketException
 Currently unimplemented.
synchronized void close () throws IOException
 Close the socket.
String toString ()

Static Package Functions

 [static initializer]

Package Attributes

NonblockingSocketImpl impl

Private Attributes

NonblockingSocket accept_tmp = null

Static Private Attributes

static final boolean DEBUG = false
static final int DEFAULT_LISTEN_BACKLOG = 511


Constructor & Destructor Documentation

seda.nbio.NonblockingServerSocket.NonblockingServerSocket int  port  )  throws IOException
 

Create a nonblocking server socket listening on the given port.

seda.nbio.NonblockingServerSocket.NonblockingServerSocket int  port,
int  backlog
throws IOException
 

Create a nonblocking server socket listening on the given port with the given connection backlog (the default is 511).

seda.nbio.NonblockingServerSocket.NonblockingServerSocket int  port,
int  backlog,
InetAddress  bindAddr
throws IOException
 

Create a nonblocking server socket listening on the given port, with the given connection backlog, bound to the given address.

This is useful if you wish to bind the socket to an address other than INADDR_ANY.


Member Function Documentation

seda.nbio.NonblockingServerSocket.[static initializer]  )  [static, package]
 

NonblockingSocket seda.nbio.NonblockingServerSocket.accept  )  throws IOException
 

Accept a connection on this server socket.

This is a blocking operation.

Returns:
A NonblockingSocket corresponding to the new connection.

synchronized void seda.nbio.NonblockingServerSocket.close  )  throws IOException
 

Close the socket.

InetAddress seda.nbio.NonblockingServerSocket.getInetAddress  ) 
 

Return the address to which this socket is bound.

int seda.nbio.NonblockingServerSocket.getLocalPort  ) 
 

Return the port to which this socket is bound.

synchronized int seda.nbio.NonblockingServerSocket.getSoTimeout  )  throws SocketException
 

Currently unimplemented.

synchronized NonblockingSocket seda.nbio.NonblockingServerSocket.nbAccept  )  throws IOException
 

Perform a nonblocking accept() on this socket.

Returns null if no connection was established. Selecting this socket for ACCEPT_READY will allow you to determine if nbAccept() will return a new connection.

See also:
SelectSet

synchronized void seda.nbio.NonblockingServerSocket.setSoTimeout int  timeout  )  throws SocketException
 

Currently unimplemented.

String seda.nbio.NonblockingServerSocket.toString  ) 
 


Member Data Documentation

NonblockingSocket seda.nbio.NonblockingServerSocket.accept_tmp = null [private]
 

final boolean seda.nbio.NonblockingServerSocket.DEBUG = false [static, private]
 

final int seda.nbio.NonblockingServerSocket.DEFAULT_LISTEN_BACKLOG = 511 [static, private]
 

NonblockingSocketImpl seda.nbio.NonblockingServerSocket.impl [package]
 


The documentation for this class was generated from the following file:
Generated on Sat Apr 2 04:10:22 2005 for libnbio2-java by  doxygen 1.4.2