|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkaos.core.service.transport.tcp.TCPCommServer
public class TCPCommServer
CommServer is a simple Object passing class that sets up a simple server that can receive Objects. It can be initialized with or port or just find an open port
Nested Class Summary | |
---|---|
class |
TCPCommServer.ClientHandler
|
class |
TCPCommServer.ServerThread
|
Field Summary | |
---|---|
protected java.lang.String |
_host
|
protected TCPMessageReceiver |
_messageReceiver
|
protected int |
_port
|
protected java.net.ServerSocket |
_serverSocket
|
Constructor Summary | |
---|---|
TCPCommServer()
testing constructor |
|
TCPCommServer(TCPMessageReceiver mr)
Normal constructor |
Method Summary | |
---|---|
void |
close()
Tries to close server socket |
java.lang.String |
getHost()
Returns the hostname of this server. |
int |
getPort()
Returns the port number of this server. |
void |
init()
Tries to start a socketserver on any available port. |
void |
init(int port)
Tries to start a socketserver on the specified port. |
void |
init(java.lang.String host,
int iPort)
Tries to start a socketserver on the specified port. |
static void |
main(java.lang.String[] args)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.net.ServerSocket _serverSocket
protected int _port
protected java.lang.String _host
protected TCPMessageReceiver _messageReceiver
Constructor Detail |
---|
public TCPCommServer(TCPMessageReceiver mr)
public TCPCommServer()
Method Detail |
---|
public void init() throws TransportFailure
CommServer
init
in interface CommServer
TransportFailure
public void init(int port) throws TransportFailure
CommServer
init
in interface CommServer
TransportFailure
public void init(java.lang.String host, int iPort) throws TransportFailure
host
- - host name (IP) to useport
- - port to use for opened socket
TransportFailure
public void close()
close
in interface CommServer
public java.lang.String getHost()
getHost
in interface CommServer
public int getPort()
getPort
in interface CommServer
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |