|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectunsw.cse.mica.agent.transport.TCPAgentConnection
public class TCPAgentConnection
An implementation of the AgentConnection
interface using TCP sockets.
TCPBlackboardConnection
Constructor Summary | |
---|---|
TCPAgentConnection(java.lang.String host,
int port)
Create a new TCP connection with ther given host and port. |
Method Summary | |
---|---|
void |
connect()
Make a connection. |
void |
disconnect()
terminate the connection. |
java.lang.String |
getHost()
Get the host specified for this connection |
java.io.InputStream |
getInputStream()
Get an input stream for this connection |
java.io.OutputStream |
getOutputStream()
Get an output stream for this connection |
int |
getPort()
Get the port specified for this connection |
boolean |
isConnected()
Check if a connection is open. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TCPAgentConnection(java.lang.String host, int port)
host
- the host on which the blackbnoard residesport
- the port on which the blackboard communicates.Method Detail |
---|
public java.lang.String getHost()
public int getPort()
public void connect() throws TransportException
AgentConnection
connect
in interface AgentConnection
TransportException
- if the connection could not be madepublic void disconnect() throws TransportException
AgentConnection
disconnect
in interface AgentConnection
TransportException
- if something went wrong...public boolean isConnected()
AgentConnection
isConnected
in interface AgentConnection
public java.io.InputStream getInputStream() throws TransportException
AgentConnection
getInputStream
in interface AgentConnection
TransportException
- if an inputstream could not be obtained for some reason.public java.io.OutputStream getOutputStream() throws TransportException
AgentConnection
getOutputStream
in interface AgentConnection
TransportException
- if an output stream could not be obtained for some reason.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |