com.caucho.network.listen
Interface SocketLink

All Known Implementing Classes:
AbstractSocketLink, StreamSocketLink, TcpSocketLink

public interface SocketLink

Represents a protocol-independent connection. Protocol servers and their associated Requests use Connection to retrieve the read and write streams and to get information about the connection.

TcpConnection is the most common implementation. The test harness provides a string based Connection.


Method Summary
 void clientDisconnect()
           
 java.lang.String getCipherSuite()
          Returns the cipher suite
 java.security.cert.X509Certificate[] getClientCertificates()
          Returns any client certificates.
 int getId()
          Returns the connection id.
 int getKeySize()
          Returns the key size.
 java.net.InetAddress getLocalAddress()
          Returns the local address of the connection
 java.lang.String getLocalHost()
          Returns the local host of the connection
 int getLocalPort()
          Returns the local port of the connection
 ReadStream getReadStream()
          Returns the connection's buffered read stream.
 java.net.InetAddress getRemoteAddress()
          Returns the remote address of the connection
 int getRemoteAddress(byte[] buffer, int offset, int length)
          Returns the remote address of the connection
 java.lang.String getRemoteHost()
          Returns the remote client's inet address.
 int getRemotePort()
          Returns the remove port of the connection
 java.lang.String getVirtualHost()
          Returns the static configured virtual host
 WriteStream getWriteStream()
          Returns the connection's buffered write stream.
 boolean isCometActive()
          Returns true for a comet connection
 boolean isCometSuspend()
          Returns true for a comet connection
 boolean isDuplex()
          Returns true for a duplex connection
 boolean isKeepaliveAllocated()
           
 boolean isPortActive()
           
 boolean isSecure()
          Returns true if secure (ssl)
 void killKeepalive(java.lang.String reason)
           
 void requestShutdownBegin()
           
 void requestShutdownEnd()
           
 SocketLinkDuplexController startDuplex(SocketLinkDuplexListener handler)
          Starts a full duplex (tcp style) request for hmtp/xmpp
 AsyncController toComet(SocketLinkCometListener cometHandler)
          Starts a comet request
 

Method Detail

getId

int getId()
Returns the connection id. Primarily for debugging.


getReadStream

ReadStream getReadStream()
Returns the connection's buffered read stream.


getWriteStream

WriteStream getWriteStream()
Returns the connection's buffered write stream.


isSecure

boolean isSecure()
Returns true if secure (ssl)


getVirtualHost

java.lang.String getVirtualHost()
Returns the static configured virtual host


getLocalAddress

java.net.InetAddress getLocalAddress()
Returns the local address of the connection


getLocalHost

java.lang.String getLocalHost()
Returns the local host of the connection


getLocalPort

int getLocalPort()
Returns the local port of the connection


getRemoteAddress

java.net.InetAddress getRemoteAddress()
Returns the remote address of the connection


getRemoteHost

java.lang.String getRemoteHost()
Returns the remote client's inet address.


getRemoteAddress

int getRemoteAddress(byte[] buffer,
                     int offset,
                     int length)
Returns the remote address of the connection


getRemotePort

int getRemotePort()
Returns the remove port of the connection


getCipherSuite

java.lang.String getCipherSuite()
Returns the cipher suite


getKeySize

int getKeySize()
Returns the key size.


getClientCertificates

java.security.cert.X509Certificate[] getClientCertificates()
                                                           throws java.security.cert.CertificateException
Returns any client certificates.

Throws:
java.security.cert.CertificateException

isPortActive

boolean isPortActive()

isKeepaliveAllocated

boolean isKeepaliveAllocated()

killKeepalive

void killKeepalive(java.lang.String reason)

requestShutdownBegin

void requestShutdownBegin()

requestShutdownEnd

void requestShutdownEnd()

toComet

AsyncController toComet(SocketLinkCometListener cometHandler)
Starts a comet request


isCometActive

boolean isCometActive()
Returns true for a comet connection


isCometSuspend

boolean isCometSuspend()
Returns true for a comet connection


isDuplex

boolean isDuplex()
Returns true for a duplex connection


startDuplex

SocketLinkDuplexController startDuplex(SocketLinkDuplexListener handler)
Starts a full duplex (tcp style) request for hmtp/xmpp


clientDisconnect

void clientDisconnect()