@Module public class TcpSocketLink extends AbstractSocketLink
Each TcpConnection has its own thread.
Modifier and Type | Method and Description |
---|---|
void |
clientDisconnect() |
java.lang.String |
getCipherSuite()
Returns the cipher suite
|
java.security.cert.X509Certificate[] |
getClientCertificates()
Returns any client certificates.
|
TcpConnectionInfo |
getConnectionInfo()
Returns the admin
|
long |
getConnectionStartTime()
Returns the time the connection started
|
static ProtocolConnection |
getCurrentRequest()
Returns the ServerRequest for the current thread.
|
java.lang.String |
getDebugId() |
java.lang.String |
getDisplayState()
Returns the user statistics state
|
int |
getId()
Returns the connection id.
|
long |
getIdleExpireTime()
Returns the idle expire time (keepalive or suspend).
|
long |
getIdleStartTime()
Returns the idle start time (keepalive or suspend)
|
long |
getIdleTimeout()
The idle time for a keepalive connection
|
int |
getKeySize()
Returns the key size.
|
com.caucho.network.listen.SocketLinkThreadLauncher |
getLauncher() |
java.net.InetAddress |
getLocalAddress()
Returns the local address of the socket.
|
java.lang.String |
getLocalHost()
Returns the local host name.
|
int |
getLocalPort()
Returns the socket's local TCP port.
|
java.lang.String |
getName()
Returns the object name for jmx.
|
TcpPort |
getPort()
Returns the port which generated the connection.
|
java.net.InetAddress |
getRemoteAddress()
Returns the socket's remote address.
|
int |
getRemoteAddress(byte[] buffer,
int offset,
int length)
Adds from the socket's remote address.
|
java.lang.String |
getRemoteHost()
Returns the socket's remote host name.
|
int |
getRemotePort()
Returns the socket's remote port
|
ProtocolConnection |
getRequest()
Returns the request for the connection.
|
long |
getRequestStartTime()
Returns the time the request started
|
java.lang.String |
getRequestUrl() |
QSocket |
getSocket()
Returns the connection's socket
|
com.caucho.network.listen.SocketLinkState |
getState()
Returns the state.
|
java.lang.Thread |
getThread() |
long |
getThreadId()
Returns the thread id.
|
java.lang.String |
getVirtualHost()
Returns the virtual host.
|
boolean |
isActive()
Returns true for active.
|
boolean |
isAsyncComplete() |
boolean |
isAsyncStarted() |
boolean |
isClosed()
Returns true for closed.
|
boolean |
isCometActive()
Returns true for a comet connection
|
boolean |
isCometSuspend()
Returns true for a comet connection
|
boolean |
isDestroyed() |
boolean |
isDuplex()
Returns true for a duplex connection
|
boolean |
isIdle() |
boolean |
isKeepaliveAllocated() |
boolean |
isPortActive() |
boolean |
isRequestActive()
Returns true for active.
|
boolean |
isSecure()
Returns true if the connection is secure, i.e.
|
void |
killKeepalive(java.lang.String reason)
Kills the keepalive, so the end of the request is the end of the
connection.
|
void |
requestDestroy()
Destroys the connection()
|
void |
requestShutdownBegin() |
void |
requestShutdownEnd() |
static void |
setCurrentRequest(ProtocolConnection request)
For QA only, set the current request.
|
void |
setIdleTimeout(long idleTimeout)
Sets the idle time for a keepalive connection.
|
SocketLinkDuplexController |
startDuplex(SocketLinkDuplexListener handler)
Starts a full duplex (tcp style) request for hmtp/xmpp
|
AsyncController |
toComet(SocketLinkCometListener cometHandler)
Starts a comet connection.
|
AsyncController |
toCometRestart(SocketLinkCometListener cometHandler)
Starts a comet connection.
|
java.lang.String |
toString() |
getReadStream, getWriteStream
public static ProtocolConnection getCurrentRequest()
public static void setCurrentRequest(ProtocolConnection request)
public int getId()
getId
in interface SocketLink
getId
in class AbstractSocketLink
public java.lang.String getDebugId()
public java.lang.String getName()
public TcpPort getPort()
public com.caucho.network.listen.SocketLinkThreadLauncher getLauncher()
public final ProtocolConnection getRequest()
public TcpConnectionInfo getConnectionInfo()
public java.lang.String getRequestUrl()
public void setIdleTimeout(long idleTimeout)
public long getIdleTimeout()
public boolean isPortActive()
public com.caucho.network.listen.SocketLinkState getState()
getState
in class AbstractSocketLink
public final boolean isIdle()
public boolean isActive()
public boolean isRequestActive()
public boolean isKeepaliveAllocated()
isKeepaliveAllocated
in interface SocketLink
isKeepaliveAllocated
in class AbstractSocketLink
public boolean isClosed()
public final boolean isDestroyed()
public boolean isCometActive()
AbstractSocketLink
isCometActive
in interface SocketLink
isCometActive
in class AbstractSocketLink
public boolean isAsyncStarted()
public boolean isAsyncComplete()
public boolean isCometSuspend()
AbstractSocketLink
isCometSuspend
in interface SocketLink
isCometSuspend
in class AbstractSocketLink
public boolean isDuplex()
AbstractSocketLink
isDuplex
in interface SocketLink
isDuplex
in class AbstractSocketLink
public QSocket getSocket()
public java.net.InetAddress getLocalAddress()
getLocalAddress
in interface SocketLink
getLocalAddress
in class AbstractSocketLink
public java.lang.String getLocalHost()
getLocalHost
in interface SocketLink
getLocalHost
in class AbstractSocketLink
public int getLocalPort()
getLocalPort
in interface SocketLink
getLocalPort
in class AbstractSocketLink
public java.net.InetAddress getRemoteAddress()
getRemoteAddress
in interface SocketLink
getRemoteAddress
in class AbstractSocketLink
public java.lang.String getRemoteHost()
getRemoteHost
in interface SocketLink
getRemoteHost
in class AbstractSocketLink
public int getRemoteAddress(byte[] buffer, int offset, int length)
getRemoteAddress
in interface SocketLink
getRemoteAddress
in class AbstractSocketLink
public int getRemotePort()
getRemotePort
in interface SocketLink
getRemotePort
in class AbstractSocketLink
public boolean isSecure()
isSecure
in interface SocketLink
isSecure
in class AbstractSocketLink
public java.lang.String getVirtualHost()
getVirtualHost
in interface SocketLink
getVirtualHost
in class AbstractSocketLink
public java.lang.String getCipherSuite()
getCipherSuite
in interface SocketLink
getCipherSuite
in class AbstractSocketLink
public int getKeySize()
getKeySize
in interface SocketLink
getKeySize
in class AbstractSocketLink
public java.security.cert.X509Certificate[] getClientCertificates() throws java.security.cert.CertificateException
getClientCertificates
in interface SocketLink
getClientCertificates
in class AbstractSocketLink
java.security.cert.CertificateException
public final long getThreadId()
public final java.lang.Thread getThread()
public final long getConnectionStartTime()
public final long getRequestStartTime()
public long getIdleExpireTime()
public long getIdleStartTime()
public java.lang.String getDisplayState()
public final void requestDestroy()
public void requestShutdownBegin()
requestShutdownBegin
in interface SocketLink
requestShutdownBegin
in class AbstractSocketLink
public void requestShutdownEnd()
requestShutdownEnd
in interface SocketLink
requestShutdownEnd
in class AbstractSocketLink
public void clientDisconnect()
public void killKeepalive(java.lang.String reason)
killKeepalive
in interface SocketLink
killKeepalive
in class AbstractSocketLink
public AsyncController toComet(SocketLinkCometListener cometHandler)
toComet
in interface SocketLink
toComet
in class AbstractSocketLink
public AsyncController toCometRestart(SocketLinkCometListener cometHandler)
toCometRestart
in interface SocketLink
toCometRestart
in class AbstractSocketLink
public SocketLinkDuplexController startDuplex(SocketLinkDuplexListener handler)
public java.lang.String toString()
toString
in class java.lang.Object