com.caucho.network.listen
Class SocketLinkDuplexController

java.lang.Object
  extended by com.caucho.network.listen.AsyncController
      extended by com.caucho.network.listen.SocketLinkDuplexController

@Module
public class SocketLinkDuplexController
extends AsyncController

Public API to control a http upgrade connection.


Constructor Summary
SocketLinkDuplexController(TcpSocketLink conn, SocketLinkDuplexListener handler)
           
 
Method Summary
 void close()
           
 void complete()
           
 SocketLinkDuplexListener getHandler()
          Returns the handler
 long getIdleTimeMax()
          Gets the max idle time.
 ReadStream getReadStream()
          Returns the read stream.
 TcpSocketLink getSocketLink()
          Returns the socket link
 WriteStream getWriteStream()
          Returns the write stream.
 boolean isCompleteRequested()
           
 boolean isDuplex()
          Returns true for a duplex controller
 void onClose()
          Closes the connection.
 void requestComplete()
           
 boolean serviceRead()
           
 void setIdleTimeMax(long idleTime)
          Sets the max idle time.
 java.lang.String toString()
           
 
Methods inherited from class com.caucho.network.listen.AsyncController
getMaxIdleTime, isAsyncStarted, isCometComplete, setMaxIdleTime, timeout, wake
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SocketLinkDuplexController

public SocketLinkDuplexController(TcpSocketLink conn,
                                  SocketLinkDuplexListener handler)
Method Detail

isDuplex

public boolean isDuplex()
Returns true for a duplex controller


setIdleTimeMax

public void setIdleTimeMax(long idleTime)
Sets the max idle time.


getIdleTimeMax

public long getIdleTimeMax()
Gets the max idle time.


getSocketLink

public TcpSocketLink getSocketLink()
Returns the socket link


getReadStream

public ReadStream getReadStream()
Returns the read stream. The read stream should only be used by the read handler.


getWriteStream

public WriteStream getWriteStream()
Returns the write stream. The write stream must be synchronized if multiple threads can write to it.


isCompleteRequested

public boolean isCompleteRequested()

requestComplete

public void requestComplete()

getHandler

public SocketLinkDuplexListener getHandler()
Returns the handler


serviceRead

public boolean serviceRead()

complete

public void complete()
Overrides:
complete in class AsyncController

close

public void close()
Overrides:
close in class AsyncController

onClose

public void onClose()
Closes the connection.

Overrides:
onClose in class AsyncController

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object