- All Known Implementing Classes:
AbstractIpService
,HttpSocketService
,MqttSocketService
public interface IpService
Network service listener that handles asynchronous I/O operations for a
non-blocking NIO server socket channel.
An IpService
interfaces with the underlying asynchronous networking
system via an IpServiceContext
. The service context invokes I/O
callbacks on the IpService
when the underlying server socket is
ready to perform I/O operations permitted by the service context's FlowControl
.
-
Method Summary
Modifier and TypeMethodDescriptionReturns a newIpSocket
binding to handle an incoming network connection.void
Lifecycle callback invoked by the service context after the underlying network listener has accepted a newsocket
connection.void
didBind()
Lifecycle callback invoked by the service context after the underlying network listener has bound to a port.void
Lifecycle callback invoked by the service context when the underlying network listener fails by throwing anerror
.void
Lifecycle callback invoked by the service context after the underlying network listener has been unbound.Returns the network listener context to which thisIpService
is bound; returnsnull
if thisIpService
is unbound.void
setIpServiceContext
(IpServiceContext context) Sets the network listener context to which thisIpService
is bound.
-
Method Details
-
ipServiceContext
IpServiceContext ipServiceContext()Returns the network listener context to which thisIpService
is bound; returnsnull
if thisIpService
is unbound. -
setIpServiceContext
Sets the network listener context to which thisIpService
is bound. -
createSocket
IpSocket createSocket()Returns a newIpSocket
binding to handle an incoming network connection. -
didBind
void didBind()Lifecycle callback invoked by the service context after the underlying network listener has bound to a port. -
didAccept
Lifecycle callback invoked by the service context after the underlying network listener has accepted a newsocket
connection. -
didUnbind
void didUnbind()Lifecycle callback invoked by the service context after the underlying network listener has been unbound. -
didFail
Lifecycle callback invoked by the service context when the underlying network listener fails by throwing anerror
. The listener will automatically be closed.
-