P
- the type of payload for outbound Message
spublic interface TcpConnection<P>
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the connection.
|
void |
onReadInactivity(Runnable runnable,
long duration)
Register a task to invoke after a period of of read inactivity.
|
void |
onWriteInactivity(Runnable runnable,
long duration)
Register a task to invoke after a period of of write inactivity.
|
ListenableFuture<Void> |
send(Message<P> message)
Send the given message.
|
ListenableFuture<Void> send(Message<P> message)
message
- the messagevoid onReadInactivity(Runnable runnable, long duration)
runnable
- the task to invokeduration
- the amount of inactive time in millisecondsvoid onWriteInactivity(Runnable runnable, long duration)
runnable
- the task to invokeduration
- the amount of inactive time in millisecondsvoid close()