|
Cliser | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--cliser.Communicator | +--cliser.TCPCommunicator
Constructor Summary | |
TCPCommunicator()
default constructor POST: my instance variables are initialized to default values: myRemoteHost == null && mySocket == null. |
|
TCPCommunicator(java.net.Socket aSocket)
|
|
TCPCommunicator(java.lang.String remoteHost,
int port)
explicit constructor |
Method Summary | |
protected void |
finalize()
destructor POST: mySocket has been closed |
java.lang.String |
getLocalHost()
local host accessor |
int |
getLocalPort()
local port accessor |
java.lang.String |
getRemoteHost()
remote host accessor |
int |
getRemotePort()
remote port accessor |
protected java.net.Socket |
getSocket()
mySocket accessor |
protected void |
initReaderAndWriter()
initialize myReader and myWriter PRE: mySocket has been initialized POST: myReader is a wrapper for mySocket.getInputStream() && myWriter is a wrapper for mySocket.getOutputStream() |
protected abstract java.net.Socket |
initSocket()
abstract socket initialization method (different in client and server Communicators) |
java.lang.String |
receive()
receive() primitive PRE: Someone is sending a message to me. |
void |
send(java.lang.String message)
send() primitive |
protected void |
setSocket(java.net.Socket aSocket)
mySocket mutator (useable only by subclasses) |
Methods inherited from class cliser.Communicator |
getPort,
toString |
Methods inherited from class java.lang.Object |
clone,
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public TCPCommunicator()
public TCPCommunicator(java.lang.String remoteHost, int port)
public TCPCommunicator(java.net.Socket aSocket)
Method Detail |
protected void initReaderAndWriter()
protected void finalize() throws java.lang.Throwable
public void send(java.lang.String message)
public java.lang.String receive()
protected abstract java.net.Socket initSocket()
protected void setSocket(java.net.Socket aSocket)
aSocket,
- a Socket
POST: mySocket == aSocket.protected final java.net.Socket getSocket()
public final int getLocalPort()
public final java.lang.String getLocalHost()
public final int getRemotePort()
public final java.lang.String getRemoteHost()
|
Cliser | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |