net.sf.asyncobjects.net.threading
Class TServerSocket

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

public class TServerSocket
extends AsyncUnicastServer<AServerSocket>
implements AServerSocket

Threading server socket


Constructor Summary
TServerSocket(VatRunner runner)
          A constructor
 
Method Summary
 Promise<ASocket> accept()
          Accept connection for the socket
 Promise<Void> bind(int port)
          Bind socket to specific port
 Promise<Void> bind(String host, int port, int backlog)
          Bind socket to specific host and port
 Promise<Void> close()
          Close socket
 
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
 

Constructor Detail

TServerSocket

public TServerSocket(VatRunner runner)
A constructor

Parameters:
runner - runner is used to create vats for streams
Method Detail

bind

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

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

bind

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

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

accept

public Promise<ASocket> accept()
Accept connection for the socket

Specified by:
accept in interface AServerSocket
Returns:
an socket that represents accepted connection
See Also:
AServerSocket.accept()

close

public Promise<Void> close()
Close socket

Specified by:
close in interface ACloseable
Returns:
a promise that resolves when object is closed.
See Also:
ACloseable.close()


Copyright 2002-2007 Constantine Plotnikov. All Rights Reserved.