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