java.lang.Object
swim.io.AbstractIpSocket
- All Implemented Interfaces:
FlowContext
,IpContext
,IpSocket
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Returns the cryptographic cipher suite used by the underlying network connection.void
close()
void
Lifecycle callback invoked by the socket context after it hasbecome
a newsocket
implementation.void
Lifecycle callback invoked by the socket context after the underlying network socket has opened a connection.void
Lifecycle callback invoked by the socket context after the underlying network connection has disconnected.void
Lifecycle callback invoked by the socket context when the underlying network socket fails by throwing anerror
.void
Lifecycle callback invoked by the socket context after the underlying network socket has established a secure connection.void
Lifecycle callback invoked by the socket context after the underlying network connection has timed out.void
didWrite()
I/O callback invoked by the socket context after the underlying network socket has completed writing all data in itsoutputBuffer
.void
doRead()
I/O callback invoked by the socket context asking thisIpSocket
to read input data out of the socket context'sinputBuffer
.void
doWrite()
I/O callback invoked by the socket context asking thisIpSocket
to write output data into the socket context'soutputBuffer
.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
(FlowModifier flowModifier) Enqueues an atomic modification to the underlying network channel's flow control state by applying aflowModifier
delta.long
Returns the number of idle milliseconds after which thisIpSocket
should be closed due to inactivity.Returns the network socket context to which thisIpSocket
is bound; returnsnull
if thisIpSocket
is unbound.boolean
isClient()
Returnstrue
if the underlying network channel initiated an outgoing connection.boolean
Returnstrue
if the underlying network channel is currently connected.boolean
isSecure()
Returnstrue
if the underlying network transport is encrypted.boolean
isServer()
Returnstrue
if the underlying network channel accepted an incoming connection.Returns the IP address and port of the local endpoint of the underlying network connection.Returns the certificate chain used to authenticate the local endpoint of the underlying network connection.Returns the authenticated identity of the local endpoint of the underlying network connection.OutputBuffer<?>
Returns the IP address and port of the remote endpoint of the underlying network connection.Returns the certificate chain used to authenticate the remote endpoint of the underlying network connection.Returns the authenticated identity of the remote endpoint of the underlying network connection.Returns the name of the transport-layer security protocol used by the underlying network connection.void
setIpSocketContext
(IpSocketContext context) Sets the network socket context to which thisIpSocket
is bound.void
willBecome
(IpSocket socket) Lifecycle callback invoked by the socket context before it hasbecome
a newsocket
implementation.void
Lifecycle callback invoked by the socket context before the underlying network socket attempts to open a connection.void
Lifecycle callback invoked by the socket context before the underlying network socket establishes a secure connection.
-
Field Details
-
context
-
-
Constructor Details
-
AbstractIpSocket
public AbstractIpSocket()
-
-
Method Details
-
ipSocketContext
Description copied from interface:IpSocket
Returns the network socket context to which thisIpSocket
is bound; returnsnull
if thisIpSocket
is unbound.- Specified by:
ipSocketContext
in interfaceIpSocket
-
setIpSocketContext
Description copied from interface:IpSocket
Sets the network socket context to which thisIpSocket
is bound.- Specified by:
setIpSocketContext
in interfaceIpSocket
-
idleTimeout
public long idleTimeout()Description copied from interface:IpSocket
Returns the number of idle milliseconds after which thisIpSocket
should be closed due to inactivity. Returns-1
if a default idle timeout should be used. Returns0
if the underlying network socket should not time out.- Specified by:
idleTimeout
in interfaceIpSocket
-
doRead
public void doRead()Description copied from interface:IpSocket
I/O callback invoked by the socket context asking thisIpSocket
to read input data out of the socket context'sinputBuffer
. May be invoked concurrently to other I/O callbacks, but never concurrently with otherdoRead
calls. -
doWrite
public void doWrite()Description copied from interface:IpSocket
I/O callback invoked by the socket context asking thisIpSocket
to write output data into the socket context'soutputBuffer
. May be invoked concurrently to other I/O callbacks, but never concurrently with otherdoWrite
ordidWrite
calls. -
didWrite
public void didWrite()Description copied from interface:IpSocket
I/O callback invoked by the socket context after the underlying network socket has completed writing all data in itsoutputBuffer
. May be invoked concurrently to other I/O callbacks, but never concurrently with otherdoWrite
ordidWrite
calls. -
willConnect
public void willConnect()Description copied from interface:IpSocket
Lifecycle callback invoked by the socket context before the underlying network socket attempts to open a connection.- Specified by:
willConnect
in interfaceIpSocket
-
didConnect
public void didConnect()Description copied from interface:IpSocket
Lifecycle callback invoked by the socket context after the underlying network socket has opened a connection.- Specified by:
didConnect
in interfaceIpSocket
-
willSecure
public void willSecure()Description copied from interface:IpSocket
Lifecycle callback invoked by the socket context before the underlying network socket establishes a secure connection.- Specified by:
willSecure
in interfaceIpSocket
-
didSecure
public void didSecure()Description copied from interface:IpSocket
Lifecycle callback invoked by the socket context after the underlying network socket has established a secure connection. -
willBecome
Description copied from interface:IpSocket
Lifecycle callback invoked by the socket context before it hasbecome
a newsocket
implementation.- Specified by:
willBecome
in interfaceIpSocket
-
didBecome
Description copied from interface:IpSocket
Lifecycle callback invoked by the socket context after it hasbecome
a newsocket
implementation. -
didTimeout
public void didTimeout()Description copied from interface:IpSocket
Lifecycle callback invoked by the socket context after the underlying network connection has timed out. The socket will automatically be closed.- Specified by:
didTimeout
in interfaceIpSocket
-
didDisconnect
public void didDisconnect()Description copied from interface:IpSocket
Lifecycle callback invoked by the socket context after the underlying network connection has disconnected.- Specified by:
didDisconnect
in interfaceIpSocket
-
didFail
Description copied from interface:IpSocket
Lifecycle callback invoked by the socket context when the underlying network socket fails by throwing anerror
. The socket will automatically be closed. -
isConnected
public boolean isConnected()Description copied from interface:IpContext
Returnstrue
if the underlying network channel is currently connected.- Specified by:
isConnected
in interfaceIpContext
-
isClient
public boolean isClient()Description copied from interface:IpContext
Returnstrue
if the underlying network channel initiated an outgoing connection. -
isServer
public boolean isServer()Description copied from interface:IpContext
Returnstrue
if the underlying network channel accepted an incoming connection. -
isSecure
public boolean isSecure()Description copied from interface:IpContext
Returnstrue
if the underlying network transport is encrypted. -
securityProtocol
Description copied from interface:IpContext
Returns the name of the transport-layer security protocol used by the underlying network connection. Returnsnull
if the underlying network channel is not currently connected, or if the underlying network connection is not secure.- Specified by:
securityProtocol
in interfaceIpContext
-
cipherSuite
Description copied from interface:IpContext
Returns the cryptographic cipher suite used by the underlying network connection. Returnsnull
if the underlying network channel is not currently connected, or if the underlying network connection is not secure.- Specified by:
cipherSuite
in interfaceIpContext
-
localAddress
Description copied from interface:IpContext
Returns the IP address and port of the local endpoint of the underlying network connection. Returnsnull
if the underlying network channel is not currently connected.- Specified by:
localAddress
in interfaceIpContext
-
localPrincipal
Description copied from interface:IpContext
Returns the authenticated identity of the local endpoint of the underlying network connection. Returnsnull
if the underlying network channel is not currently connected, or if the underlying network connection is not authenticated.- Specified by:
localPrincipal
in interfaceIpContext
-
localCertificates
Description copied from interface:IpContext
Returns the certificate chain used to authenticate the local endpoint of the underlying network connection. Returnsnull
if the underlying network channel is not currently connected, or if the underlying network connection is not authenticated.- Specified by:
localCertificates
in interfaceIpContext
-
remoteAddress
Description copied from interface:IpContext
Returns the IP address and port of the remote endpoint of the underlying network connection. Returnsnull
if the underlying network channel is not currently connected.- Specified by:
remoteAddress
in interfaceIpContext
-
remotePrincipal
Description copied from interface:IpContext
Returns the authenticated identity of the remote endpoint of the underlying network connection. Returnsnull
if the underlying network channel is not currently connected, or if the underlying network connection is not authenticated.- Specified by:
remotePrincipal
in interfaceIpContext
-
remoteCertificates
Description copied from interface:IpContext
Returns the certificate chain used to authenticate the remote endpoint of the underlying network connection. Returnsnull
if the underlying network channel is not currently connected, or if the underlying network connection is not authenticated.- Specified by:
remoteCertificates
in interfaceIpContext
-
flowControl
Description copied from interface:FlowContext
Returns the currentFlowControl
state of the underlying network channel.- Specified by:
flowControl
in interfaceFlowContext
-
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
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
-
ipSettings
-
inputBuffer
-
outputBuffer
-
become
-
close
public void close()
-