public class TCPConnection extends ConnectionBase implements MessageReceiver, Callable<Object>
Connection
that manages a non-blocking TCP
connection to a single remote host.theCloseMarker
Modifier and Type | Method and Description |
---|---|
Object |
call()
Invoked from the selector thread's work queue when the selector is ready
to do a write.
|
void |
close()
Shut down the connection.
|
boolean |
isWritable()
Test if this connection is available for writes.
|
String |
label()
Get a short string for labelling this connection in log entries.
|
void |
receiveMsg(Object message)
Receive an incoming message from the remote end.
|
void |
sendMsg(Object message)
Send a message to the other end of the connection.
|
String |
toString()
Obtain a printable String representation of this connection.
|
connectionDied, enqueueHandlerFactory, enqueueReceivedMessage, id, setDebugMode
public Object call()
public void close()
close
in interface Connection
public boolean isWritable()
public String label()
public void receiveMsg(Object message)
receiveMsg
in interface MessageReceiver
message
- the incoming message.public void sendMsg(Object message)
sendMsg
in interface Connection
message
- The message to be sent.Copyright © 2017. All rights reserved.