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

nbio.NonblockingServerSocket Class Reference

Inherits 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

final boolean DEBUG = false
final int DEFAULT_LISTEN_BACKLOG = 511


Constructor & Destructor Documentation

nbio.NonblockingServerSocket.NonblockingServerSocket int  port  )  throws IOException
 

Create a nonblocking server socket listening on the given port.

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).

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

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

NonblockingSocket 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 nbio.NonblockingServerSocket.close  )  throws IOException
 

Close the socket.

InetAddress nbio.NonblockingServerSocket.getInetAddress  ) 
 

Return the address to which this socket is bound.

int nbio.NonblockingServerSocket.getLocalPort  ) 
 

Return the port to which this socket is bound.

synchronized int nbio.NonblockingServerSocket.getSoTimeout  )  throws SocketException
 

Currently unimplemented.

synchronized NonblockingSocket 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 nbio.NonblockingServerSocket.setSoTimeout int  timeout  )  throws SocketException
 

Currently unimplemented.

String nbio.NonblockingServerSocket.toString  ) 
 


Member Data Documentation

NonblockingSocket nbio.NonblockingServerSocket.accept_tmp = null [private]
 

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

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

NonblockingSocketImpl nbio.NonblockingServerSocket.impl [package]
 


The documentation for this class was generated from the following file:
Generated on Fri Jul 18 21:37:51 2003 for libnbio2-java by doxygen 1.3.2