-
- All Superinterfaces:
FlowContext
,IpContext
- All Known Implementing Classes:
IpSocketModem
public interface IpModemContext<I,O> extends IpContext, FlowContext
Network socket context that manages asynchronous I/O decoders and encoders for a non-blocking NIO network channel. AnIpModemContext
is implicitly bound to aIpModem
, providing theIpModem
with the ability to modify itsFlowControl
state, enqueue read decoders and write encoders, tobecome
a different kind ofIpSocket
, and to close the socket.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
become(IpSocket socket)
Rebinds the underlyingIpSocketContext
to a newsocket
implementation, thereby changing theIpSocket
handler that receives network I/O callbacks.void
close()
Closes the underlying network socket.IpSettings
ipSettings()
Returns the configuration parameters that govern the underlying network socket.<I2 extends I>
voidread(Decoder<I2> decoder)
Enqueues a readdecoder
to which input data will be asynchronously fed.<O2 extends O>
voidwrite(Encoder<?,O2> encoder)
Enqueues a writeencoder
from which output data will be asynchronously pulled.-
Methods inherited from interface swim.io.FlowContext
flowControl, flowControl, flowControl
-
Methods inherited from interface swim.io.IpContext
cipherSuite, isClient, isConnected, isSecure, isServer, localAddress, localCertificates, localPrincipal, remoteAddress, remoteCertificates, remotePrincipal, securityProtocol
-
-
-
-
Method Detail
-
ipSettings
IpSettings ipSettings()
Returns the configuration parameters that govern the underlying network socket.
-
read
<I2 extends I> void read(Decoder<I2> decoder)
Enqueues a readdecoder
to which input data will be asynchronously fed. The read flow control of the underlying network socket is automatically managed using the state of the readdecoder
. When the readdecoder
transitions into the done state, thedidRead
callback of the boundIpModem
will be invoked with the decoded result. If the readdecoder
transitions into the error state, then thedidFail
callback of the boundIpModem
will be invoked with the decode error.
-
write
<O2 extends O> void write(Encoder<?,O2> encoder)
Enqueues a writeencoder
from which output data will be asynchronously pulled. The write flow control of the underlying network socket is automatically managed using the state of the writeencoder
. When the writeencoder
transitions into the done state, thedidWrite
callback of the boundIpModem
will be invoked with the encoded result. If the writeencoder
transitions into the error state, then thedidFail
callback of the boundIpModem
will be invoked with the encode error.
-
become
void become(IpSocket socket)
Rebinds the underlyingIpSocketContext
to a newsocket
implementation, thereby changing theIpSocket
handler that receives network I/O callbacks.
-
close
void close()
Closes the underlying network socket.
-
-