- java.lang.Object
-
- swim.io.http.HttpSocketService
-
- All Implemented Interfaces:
FlowContext
,HttpServiceContext
,IpService
public class HttpSocketService extends Object implements IpService, HttpServiceContext
-
-
Field Summary
Fields Modifier and Type Field Description protected IpServiceContext
context
protected HttpSettings
httpSettings
protected HttpService
service
-
Constructor Summary
Constructors Constructor Description HttpSocketService(HttpService service, HttpSettings httpSettings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IpSocket
createSocket()
Returns a newIpSocket
binding to handle an incoming network connection.void
didAccept(IpSocket socket)
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
didFail(Throwable error)
Lifecycle callback invoked by the service context when the underlying network listener fails by throwing anerror
.void
didUnbind()
Lifecycle callback invoked by the service context after the underlying network listener has been unbound.FlowControl
flowControl()
Returns the currentFlowControl
state of the underlying network channel.void
flowControl(FlowControl flowControl)
Enqueues an atomic replacement of the underlying network channel's flow control state with a newflowControl
.FlowControl
flowControl(FlowModifier flowModifier)
Enqueues an atomic modification to the underlying network channel's flow control state by applying aflowModifier
delta.HttpSettings
httpSettings()
IpServiceContext
ipServiceContext()
Returns the network listener context to which thisIpService
is bound; returnsnull
if thisIpService
is unbound.InetSocketAddress
localAddress()
void
setIpServiceContext(IpServiceContext context)
Sets the network listener context to which thisIpService
is bound.void
unbind()
-
-
-
Field Detail
-
service
protected final HttpService service
-
httpSettings
protected final HttpSettings httpSettings
-
context
protected IpServiceContext context
-
-
Constructor Detail
-
HttpSocketService
public HttpSocketService(HttpService service, HttpSettings httpSettings)
-
-
Method Detail
-
ipServiceContext
public IpServiceContext ipServiceContext()
Description copied from interface:IpService
Returns the network listener context to which thisIpService
is bound; returnsnull
if thisIpService
is unbound.- Specified by:
ipServiceContext
in interfaceIpService
-
setIpServiceContext
public void setIpServiceContext(IpServiceContext context)
Description copied from interface:IpService
Sets the network listener context to which thisIpService
is bound.- Specified by:
setIpServiceContext
in interfaceIpService
-
createSocket
public IpSocket createSocket()
Description copied from interface:IpService
Returns a newIpSocket
binding to handle an incoming network connection.- Specified by:
createSocket
in interfaceIpService
-
didBind
public void didBind()
Description copied from interface:IpService
Lifecycle callback invoked by the service context after the underlying network listener has bound to a port.
-
didAccept
public void didAccept(IpSocket socket)
Description copied from interface:IpService
Lifecycle callback invoked by the service context after the underlying network listener has accepted a newsocket
connection.
-
didUnbind
public void didUnbind()
Description copied from interface:IpService
Lifecycle callback invoked by the service context after the underlying network listener has been unbound.
-
didFail
public void didFail(Throwable error)
Description copied from interface:IpService
Lifecycle callback invoked by the service context when the underlying network listener fails by throwing anerror
. The listener will automatically be closed.
-
flowControl
public FlowControl flowControl()
Description copied from interface:FlowContext
Returns the currentFlowControl
state of the underlying network channel.- Specified by:
flowControl
in interfaceFlowContext
-
flowControl
public void flowControl(FlowControl flowControl)
Description copied from interface:FlowContext
Enqueues an atomic replacement of the underlying network channel's flow control state with a newflowControl
.- Specified by:
flowControl
in interfaceFlowContext
-
flowControl
public FlowControl flowControl(FlowModifier flowModifier)
Description copied from interface:FlowContext
Enqueues an atomic modification to the underlying network channel's flow control state by applying aflowModifier
delta.- Specified by:
flowControl
in interfaceFlowContext
-
httpSettings
public HttpSettings httpSettings()
- Specified by:
httpSettings
in interfaceHttpServiceContext
-
localAddress
public InetSocketAddress localAddress()
- Specified by:
localAddress
in interfaceHttpServiceContext
-
unbind
public void unbind()
- Specified by:
unbind
in interfaceHttpServiceContext
-
-