com.caucho.vfs
Class QSocketWrapper

java.lang.Object
  extended by com.caucho.vfs.QSocket
      extended by com.caucho.vfs.QSocketWrapper

@Module
public class QSocketWrapper
extends QSocket

Abstract socket to handle both normal sockets and bin/resin sockets.


Constructor Summary
QSocketWrapper()
           
QSocketWrapper(java.net.Socket s)
           
 
Method Summary
 void close()
          Closes the underlying socket.
 int getCipherBits()
          Returns the bits in the socket.
 java.lang.String getCipherSuite()
          Returns the secure cipher algorithm.
 java.security.cert.X509Certificate getClientCertificate()
          Returns the client certificate.
 java.security.cert.X509Certificate[] getClientCertificates()
          Returns the client certificate.
 java.net.InetAddress getLocalAddress()
          Returns the server inet address that accepted the request.
 int getLocalPort()
          Returns the server port that accepted the request.
 java.net.InetAddress getRemoteAddress()
          Returns the remote client's inet address.
 int getRemotePort()
          Returns the remote client's port.
 java.nio.channels.SelectableChannel getSelectableChannel()
          Returns the selectable channel.
 java.net.Socket getSocket()
           
 StreamImpl getStream()
          Returns the socket's input stream.
 long getTotalReadBytes()
          Returns the total number of bytes read from the socket connection.
 long getTotalWriteBytes()
          Returns the total number of bytes written to the socket connection.
 void init(java.net.Socket s)
           
 boolean isClosed()
          Returns true for closes.
 boolean isSecure()
          Returns true if the connection is secure.
 void resetTotalBytes()
           
 void setReadTimeout(int ms)
          Sets the socket timeout.
 java.lang.String toString()
           
 
Methods inherited from class com.caucho.vfs.QSocket
forceShutdown, getLocalHost, getRemoteAddress, getRemoteHost, getRemoteIP, isEof, setRequestExpireTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QSocketWrapper

public QSocketWrapper()

QSocketWrapper

public QSocketWrapper(java.net.Socket s)
Method Detail

init

public void init(java.net.Socket s)

getSocket

public java.net.Socket getSocket()

setReadTimeout

public void setReadTimeout(int ms)
                    throws java.io.IOException
Sets the socket timeout.

Throws:
java.io.IOException

getLocalAddress

public java.net.InetAddress getLocalAddress()
Returns the server inet address that accepted the request.

Specified by:
getLocalAddress in class QSocket

getLocalPort

public int getLocalPort()
Returns the server port that accepted the request.

Specified by:
getLocalPort in class QSocket

getRemoteAddress

public java.net.InetAddress getRemoteAddress()
Returns the remote client's inet address.

Specified by:
getRemoteAddress in class QSocket

getRemotePort

public int getRemotePort()
Returns the remote client's port.

Specified by:
getRemotePort in class QSocket

isSecure

public boolean isSecure()
Returns true if the connection is secure.

Overrides:
isSecure in class QSocket

getCipherSuite

public java.lang.String getCipherSuite()
Returns the secure cipher algorithm.

Overrides:
getCipherSuite in class QSocket

getCipherBits

public int getCipherBits()
Returns the bits in the socket.

Overrides:
getCipherBits in class QSocket

getClientCertificate

public java.security.cert.X509Certificate getClientCertificate()
                                                        throws java.security.cert.CertificateException
Returns the client certificate.

Overrides:
getClientCertificate in class QSocket
Throws:
java.security.cert.CertificateException

getClientCertificates

public java.security.cert.X509Certificate[] getClientCertificates()
                                                           throws java.security.cert.CertificateException
Returns the client certificate.

Overrides:
getClientCertificates in class QSocket
Throws:
java.security.cert.CertificateException

getSelectableChannel

public java.nio.channels.SelectableChannel getSelectableChannel()
Returns the selectable channel.

Overrides:
getSelectableChannel in class QSocket

getStream

public StreamImpl getStream()
                     throws java.io.IOException
Returns the socket's input stream.

Specified by:
getStream in class QSocket
Throws:
java.io.IOException

resetTotalBytes

public void resetTotalBytes()

getTotalReadBytes

public long getTotalReadBytes()
Description copied from class: QSocket
Returns the total number of bytes read from the socket connection.

Specified by:
getTotalReadBytes in class QSocket

getTotalWriteBytes

public long getTotalWriteBytes()
Description copied from class: QSocket
Returns the total number of bytes written to the socket connection.

Specified by:
getTotalWriteBytes in class QSocket

isClosed

public boolean isClosed()
Returns true for closes.

Specified by:
isClosed in class QSocket

close

public void close()
           throws java.io.IOException
Closes the underlying socket.

Specified by:
close in class QSocket
Throws:
java.io.IOException

toString

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