kaos.core.service.transport.tcp
Class TCPCommClient
java.lang.Object
kaos.core.service.transport.tcp.TCPCommClient
- All Implemented Interfaces:
- CommClient
public class TCPCommClient
- extends java.lang.Object
- implements CommClient
Field Summary |
protected java.io.ObjectOutputStream |
_oos
|
protected java.net.Socket |
_socket
|
Method Summary |
void |
close()
Closes any open connections. |
void |
init(java.lang.String host,
int port)
Tries to connect to the specified host on the specified port
and open an object output stream to it. |
static void |
main(java.lang.String[] args)
|
void |
SendObject(java.io.Serializable obj)
Sends the specified Serializable object across the ObjectOutputStream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_socket
protected java.net.Socket _socket
_oos
protected java.io.ObjectOutputStream _oos
TCPCommClient
public TCPCommClient()
- used for testing
init
public void init(java.lang.String host,
int port)
throws TransportFailure
- Tries to connect to the specified host on the specified port
and open an object output stream to it.
- Specified by:
init
in interface CommClient
- Parameters:
String
- hostint
- port
- Throws:
TransportFailure
close
public void close()
- Closes any open connections.
- Specified by:
close
in interface CommClient
SendObject
public void SendObject(java.io.Serializable obj)
throws TransportFailure
- Sends the specified Serializable object across the ObjectOutputStream.
- Specified by:
SendObject
in interface CommClient
- Parameters:
serializable
- object to send
- Throws:
TransportFailure
main
public static void main(java.lang.String[] args)