|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exolab.core.ipc.TcpServerService
Create a listener socket and wait for requests to come in. When a connection is made add the new object to the list of active connections and spawn a new thread to listen to the connection.
org.exolab.core.ipc.IpcServerService
,
TcpService
,
Server
Constructor Summary | |
TcpServerService(java.net.InetAddress address,
int port,
NotifierIfc notifier)
Sets up a listener port and adds a notifier to call with all received messages. |
|
TcpServerService(int port,
NotifierIfc notifier)
Sets up a listener port and adds a notifier to call with all received messages. |
|
TcpServerService(NotifierIfc notifier)
Sets up a listener port on the next free port as allocated by the system and adds a notifier to call with all received messages. |
Method Summary | |
java.lang.String |
getHost()
Return the machines address. |
int |
getPort()
Return the port number this server is listening on. |
void |
shutdownAll()
Shutdown all active connections, including the server connection. |
void |
start()
Start the service running. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TcpServerService(NotifierIfc notifier) throws java.io.IOException
notifier
- the client handle to call when data is received.public TcpServerService(int port, NotifierIfc notifier) throws java.io.IOException
port
- the port to accept connections on.notifier
- the client handle to call when data is received.public TcpServerService(java.net.InetAddress address, int port, NotifierIfc notifier) throws java.io.IOException
address
- the local IP address to bind to. May be null.port
- the port to accept connections on.notifier
- the client handle to call when data is received.Method Detail |
public void start()
start
in interface IpcServerIfc
java.io.IOException
- If a failure on connection occurs.public void shutdownAll() throws java.io.IOException
shutdownAll
in interface IpcServerIfc
java.io.IOException
- If the service reports an error during shutdown.public int getPort()
getPort
in interface IpcServerIfc
public java.lang.String getHost()
getHost
in interface IpcServerIfc
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |