net.sf.asyncobjects.net.nio
Class NIOServerSocket

java.lang.Object
  extended by net.sf.asyncobjects.AsyncUnicastServer<AServerSocket>
      extended by net.sf.asyncobjects.net.nio.NIOServerSocket
All Implemented Interfaces:
ACloseable, AsyncObject, ExplicitSharing, AServerSocket

public class NIOServerSocket
extends AsyncUnicastServer<AServerSocket>
implements AServerSocket

Implementation of server sockets based on nio.


Method Summary
 Promise<ASocket> accept()
          Accept connection
 Promise<Void> bind(int port)
          Bind socket
 Promise<Void> bind(String host, int port, int backlog)
          Bind socket
 Promise<Void> close()
          Perform close operation
 
Methods inherited from class net.sf.asyncobjects.AsyncUnicastServer
dereference, export, isImmediate, myVat, promise
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.asyncobjects.AsyncObject
dereference, isImmediate
 

Method Detail

bind

public Promise<Void> bind(int port)
Bind socket

Specified by:
bind in interface AServerSocket
Parameters:
port - a port
Returns:
bound socket when operation finishes
See Also:
AServerSocket.bind(int)

bind

public Promise<Void> bind(String host,
                          int port,
                          int backlog)
Bind socket

Specified by:
bind in interface AServerSocket
Parameters:
host - a host
port - a port
backlog - a backlog
Returns:
bound socket when operation finishes
See Also:
AServerSocket.bind(String, int, int)

accept

public Promise<ASocket> accept()
Accept connection

Specified by:
accept in interface AServerSocket
Returns:
promise for accepted socket
See Also:
AServerSocket.accept()

close

public Promise<Void> close()
Perform close operation

Specified by:
close in interface ACloseable
Returns:
a promise that reutnrs when stream is closed


Copyright 2002-2007 Constantine Plotnikov. All Rights Reserved.