- 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 TypeMethodDescriptionvoid
Rebinds the underlyingIpSocketContext
to a newsocket
implementation, thereby changing theIpSocket
handler that receives network I/O callbacks.void
close()
Closes the underlying network socket.Returns the configuration parameters that govern the underlying network socket.<I2 extends I>
voidEnqueues a readdecoder
to which input data will be asynchronously fed.<O2 extends O>
voidEnqueues 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 Details
-
ipSettings
IpSettings ipSettings()Returns the configuration parameters that govern the underlying network socket. -
read
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
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
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.
-