-
- 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. AnIpModemContextis implicitly bound to aIpModem, providing theIpModemwith the ability to modify itsFlowControlstate, enqueue read decoders and write encoders, tobecomea different kind ofIpSocket, and to close the socket.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidbecome(IpSocket socket)Rebinds the underlyingIpSocketContextto a newsocketimplementation, thereby changing theIpSockethandler that receives network I/O callbacks.voidclose()Closes the underlying network socket.IpSettingsipSettings()Returns the configuration parameters that govern the underlying network socket.<I2 extends I>
voidread(Decoder<I2> decoder)Enqueues a readdecoderto which input data will be asynchronously fed.<O2 extends O>
voidwrite(Encoder<?,O2> encoder)Enqueues a writeencoderfrom 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 readdecoderto 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 readdecodertransitions into the done state, thedidReadcallback of the boundIpModemwill be invoked with the decoded result. If the readdecodertransitions into the error state, then thedidFailcallback of the boundIpModemwill be invoked with the decode error.
-
write
<O2 extends O> void write(Encoder<?,O2> encoder)
Enqueues a writeencoderfrom 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 writeencodertransitions into the done state, thedidWritecallback of the boundIpModemwill be invoked with the encoded result. If the writeencodertransitions into the error state, then thedidFailcallback of the boundIpModemwill be invoked with the encode error.
-
become
void become(IpSocket socket)
Rebinds the underlyingIpSocketContextto a newsocketimplementation, thereby changing theIpSockethandler that receives network I/O callbacks.
-
close
void close()
Closes the underlying network socket.
-
-