public abstract class SoupBinTCPSession extends Object implements Closeable
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the underlying socket channel.
|
SocketChannel |
getChannel()
Get the underlying socket channel.
|
void |
keepAlive()
Keep the session alive.
|
int |
receive()
Receive data from the underlying socket channel.
|
public SocketChannel getChannel()
public int receive() throws IOException
-1
if the channel has reached end-of-streamIOException
- if an I/O error occurspublic void keepAlive() throws IOException
If the heartbeat interval duration has passed since the last packet was sent, send a Heartbeat packet. If the heartbeat timeout duration has passed since the last packet was received, invoke the corresponding method on the status listener.
IOException
- if an I/O error occurspublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
- if an I/O error occursCopyright © 2017. All rights reserved.