- All Superinterfaces:
FlowContext,IpContext
- All Known Implementing Classes:
IpSocketModem
Network socket context that manages asynchronous I/O decoders and encoders
for a non-blocking NIO network channel. An
IpModemContext is
implicitly bound to a IpModem, providing the IpModem with
the ability to modify its FlowControl state, enqueue read decoders
and write encoders, to become a different kind of
IpSocket, and to close the socket.-
Method Summary
Modifier and TypeMethodDescriptionvoidRebinds the underlyingIpSocketContextto a newsocketimplementation, thereby changing theIpSockethandler that receives network I/O callbacks.voidclose()Closes the underlying network socket.Returns the configuration parameters that govern the underlying network socket.<I2 extends I>
voidEnqueues a readdecoderto which input data will be asynchronously fed.<O2 extends O>
voidEnqueues a writeencoderfrom which output data will be asynchronously pulled.Methods inherited from interface swim.io.FlowContext
flowControl, flowControl, flowControlMethods inherited from interface swim.io.IpContext
cipherSuite, isClient, isConnected, isSecure, isServer, localAddress, localCertificates, localPrincipal, remoteAddress, remoteCertificates, remotePrincipal, securityProtocol
-
Method Details
-
ipSettings
IpSettings ipSettings()Returns the configuration parameters that govern the underlying network socket. -
read
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
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
Rebinds the underlyingIpSocketContextto a newsocketimplementation, thereby changing theIpSockethandler that receives network I/O callbacks. -
close
void close()Closes the underlying network socket.
-