@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, getWriteStreampublic static ProtocolConnection getCurrentRequest()
public static void setCurrentRequest(ProtocolConnection request)
public int getId()
getId in interface SocketLinkgetId in class AbstractSocketLinkpublic 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 AbstractSocketLinkpublic final boolean isIdle()
public boolean isActive()
public boolean isRequestActive()
public boolean isKeepaliveAllocated()
isKeepaliveAllocated in interface SocketLinkisKeepaliveAllocated in class AbstractSocketLinkpublic boolean isClosed()
public final boolean isDestroyed()
public boolean isCometActive()
AbstractSocketLinkisCometActive in interface SocketLinkisCometActive in class AbstractSocketLinkpublic boolean isAsyncStarted()
public boolean isAsyncComplete()
public boolean isCometSuspend()
AbstractSocketLinkisCometSuspend in interface SocketLinkisCometSuspend in class AbstractSocketLinkpublic boolean isDuplex()
AbstractSocketLinkisDuplex in interface SocketLinkisDuplex in class AbstractSocketLinkpublic QSocket getSocket()
public java.net.InetAddress getLocalAddress()
getLocalAddress in interface SocketLinkgetLocalAddress in class AbstractSocketLinkpublic java.lang.String getLocalHost()
getLocalHost in interface SocketLinkgetLocalHost in class AbstractSocketLinkpublic int getLocalPort()
getLocalPort in interface SocketLinkgetLocalPort in class AbstractSocketLinkpublic java.net.InetAddress getRemoteAddress()
getRemoteAddress in interface SocketLinkgetRemoteAddress in class AbstractSocketLinkpublic java.lang.String getRemoteHost()
getRemoteHost in interface SocketLinkgetRemoteHost in class AbstractSocketLinkpublic int getRemoteAddress(byte[] buffer,
int offset,
int length)
getRemoteAddress in interface SocketLinkgetRemoteAddress in class AbstractSocketLinkpublic int getRemotePort()
getRemotePort in interface SocketLinkgetRemotePort in class AbstractSocketLinkpublic boolean isSecure()
isSecure in interface SocketLinkisSecure in class AbstractSocketLinkpublic java.lang.String getVirtualHost()
getVirtualHost in interface SocketLinkgetVirtualHost in class AbstractSocketLinkpublic java.lang.String getCipherSuite()
getCipherSuite in interface SocketLinkgetCipherSuite in class AbstractSocketLinkpublic int getKeySize()
getKeySize in interface SocketLinkgetKeySize in class AbstractSocketLinkpublic java.security.cert.X509Certificate[] getClientCertificates()
throws java.security.cert.CertificateException
getClientCertificates in interface SocketLinkgetClientCertificates in class AbstractSocketLinkjava.security.cert.CertificateExceptionpublic 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 SocketLinkrequestShutdownBegin in class AbstractSocketLinkpublic void requestShutdownEnd()
requestShutdownEnd in interface SocketLinkrequestShutdownEnd in class AbstractSocketLinkpublic void clientDisconnect()
public void killKeepalive(java.lang.String reason)
killKeepalive in interface SocketLinkkillKeepalive in class AbstractSocketLinkpublic AsyncController toComet(SocketLinkCometListener cometHandler)
toComet in interface SocketLinktoComet in class AbstractSocketLinkpublic AsyncController toCometRestart(SocketLinkCometListener cometHandler)
toCometRestart in interface SocketLinktoCometRestart in class AbstractSocketLinkpublic SocketLinkDuplexController startDuplex(SocketLinkDuplexListener handler)
public java.lang.String toString()
toString in class java.lang.Object