com.caucho.network.listen
Class StreamSocketLink

java.lang.Object
  extended by com.caucho.network.listen.AbstractSocketLink
      extended by com.caucho.network.listen.StreamSocketLink
All Implemented Interfaces:
SocketLink

public class StreamSocketLink
extends AbstractSocketLink

A Connection based on streams. Stream connection is primarily used for testing.


Constructor Summary
StreamSocketLink()
           
StreamSocketLink(java.io.InputStream is, java.io.OutputStream os)
           
 
Method Summary
 void clientDisconnect()
           
 int getId()
          Returns the connection id.
 java.net.InetAddress getLocalAddress()
          Returns the local address of the connection
 int getLocalPort()
          Returns the local port of the connection
 java.net.InetAddress getRemoteAddress()
          Returns the remote address of the connection
 int getRemotePort()
          Returns the remove port of the connection
 java.lang.String getVirtualHost()
          Returns the static virtual host
 boolean isKeepaliveAllocated()
           
 boolean isPortActive()
           
 boolean isSecure()
          Returns true if secure (ssl)
 void killKeepalive(java.lang.String reason)
           
 void onRequestComplete()
           
 void setLocalAddress(java.net.InetAddress addr)
           
 void setLocalPort(int port)
           
 void setRemoteAddress(java.net.InetAddress addr)
           
 void setRemotePort(int port)
           
 void setSecure(boolean isSecure)
           
 void setStream(java.io.InputStream is, java.io.OutputStream os)
           
 void setVirtualHost(java.lang.String virtualHost)
           
 SocketLinkDuplexController startDuplex(SocketLinkDuplexListener handler)
          Starts a full duplex (tcp style) request for hmtp/xmpp
 AsyncController toComet(SocketLinkCometListener handler)
          Starts a comet request
 
Methods inherited from class com.caucho.network.listen.AbstractSocketLink
getCipherSuite, getClientCertificates, getKeySize, getLocalHost, getReadStream, getRemoteAddress, getRemoteHost, getState, getWriteStream, isCometActive, isCometSuspend, isDuplex, requestShutdownBegin, requestShutdownEnd
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamSocketLink

public StreamSocketLink()

StreamSocketLink

public StreamSocketLink(java.io.InputStream is,
                        java.io.OutputStream os)
Method Detail

getId

public int getId()
Description copied from class: AbstractSocketLink
Returns the connection id. Primarily for debugging.

Specified by:
getId in interface SocketLink
Specified by:
getId in class AbstractSocketLink

getLocalAddress

public java.net.InetAddress getLocalAddress()
Description copied from class: AbstractSocketLink
Returns the local address of the connection

Specified by:
getLocalAddress in interface SocketLink
Specified by:
getLocalAddress in class AbstractSocketLink

getLocalPort

public int getLocalPort()
Description copied from class: AbstractSocketLink
Returns the local port of the connection

Specified by:
getLocalPort in interface SocketLink
Specified by:
getLocalPort in class AbstractSocketLink

isPortActive

public boolean isPortActive()

getRemoteAddress

public java.net.InetAddress getRemoteAddress()
Description copied from class: AbstractSocketLink
Returns the remote address of the connection

Specified by:
getRemoteAddress in interface SocketLink
Specified by:
getRemoteAddress in class AbstractSocketLink

getRemotePort

public int getRemotePort()
Description copied from class: AbstractSocketLink
Returns the remove port of the connection

Specified by:
getRemotePort in interface SocketLink
Specified by:
getRemotePort in class AbstractSocketLink

setRemotePort

public void setRemotePort(int port)

getVirtualHost

public java.lang.String getVirtualHost()
Description copied from class: AbstractSocketLink
Returns the static virtual host

Specified by:
getVirtualHost in interface SocketLink
Overrides:
getVirtualHost in class AbstractSocketLink

setVirtualHost

public void setVirtualHost(java.lang.String virtualHost)

setStream

public void setStream(java.io.InputStream is,
                      java.io.OutputStream os)

setSecure

public void setSecure(boolean isSecure)

isSecure

public boolean isSecure()
Description copied from class: AbstractSocketLink
Returns true if secure (ssl)

Specified by:
isSecure in interface SocketLink
Overrides:
isSecure in class AbstractSocketLink

isKeepaliveAllocated

public boolean isKeepaliveAllocated()
Specified by:
isKeepaliveAllocated in interface SocketLink
Overrides:
isKeepaliveAllocated in class AbstractSocketLink

killKeepalive

public void killKeepalive(java.lang.String reason)
Specified by:
killKeepalive in interface SocketLink
Overrides:
killKeepalive in class AbstractSocketLink

clientDisconnect

public void clientDisconnect()

setLocalAddress

public void setLocalAddress(java.net.InetAddress addr)

setLocalPort

public void setLocalPort(int port)

setRemoteAddress

public void setRemoteAddress(java.net.InetAddress addr)

toComet

public AsyncController toComet(SocketLinkCometListener handler)
Description copied from class: AbstractSocketLink
Starts a comet request

Specified by:
toComet in interface SocketLink
Overrides:
toComet in class AbstractSocketLink

onRequestComplete

public void onRequestComplete()

startDuplex

public SocketLinkDuplexController startDuplex(SocketLinkDuplexListener handler)
Description copied from interface: SocketLink
Starts a full duplex (tcp style) request for hmtp/xmpp