com.caucho.vfs
Class QSocket

java.lang.Object
  extended by com.caucho.vfs.QSocket
Direct Known Subclasses:
JniSocketImpl, QSocketChannelWrapper, QSocketWrapper

@Module
public abstract class QSocket
extends java.lang.Object

Abstract socket to handle both normal sockets and JNI sockets.


Constructor Summary
QSocket()
           
 
Method Summary
abstract  void close()
           
 void forceShutdown()
           
 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 chain.
abstract  java.net.InetAddress getLocalAddress()
          Returns the server inet address that accepted the request.
 java.lang.String getLocalHost()
          Returns the server inet address that accepted the request.
abstract  int getLocalPort()
          Returns the server port that accepted the request.
abstract  java.net.InetAddress getRemoteAddress()
          Returns the remote client's inet address.
 int getRemoteAddress(byte[] buffer, int offset, int length)
          Returns the remote client's inet address.
 java.lang.String getRemoteHost()
          Returns the remote client's inet address.
 byte[] getRemoteIP()
          Returns the remote client's inet address.
abstract  int getRemotePort()
          Returns the remote client's port.
 java.nio.channels.SelectableChannel getSelectableChannel()
          Returns any selectable channel.
abstract  StreamImpl getStream()
          Returns a stream impl for the socket encapsulating the input and output stream.
abstract  long getTotalReadBytes()
          Returns the total number of bytes read from the socket connection.
abstract  long getTotalWriteBytes()
          Returns the total number of bytes written to the socket connection.
abstract  boolean isClosed()
          returns true if it's closed.
 boolean isEof()
           
 boolean isSecure()
          Returns true if the connection is secure.
 void setRequestExpireTime(long expireTime)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QSocket

public QSocket()
Method Detail

getLocalAddress

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


getLocalHost

public java.lang.String getLocalHost()
Returns the server inet address that accepted the request.


getLocalPort

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


getRemoteAddress

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


getRemoteHost

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


getRemoteAddress

public int getRemoteAddress(byte[] buffer,
                            int offset,
                            int length)
Returns the remote client's inet address.


getRemoteIP

public byte[] getRemoteIP()
Returns the remote client's inet address.


getRemotePort

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


isSecure

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


getSelectableChannel

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


getCipherSuite

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


getCipherBits

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


getClientCertificate

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

Throws:
java.security.cert.CertificateException

getClientCertificates

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

Throws:
java.security.cert.CertificateException

setRequestExpireTime

public void setRequestExpireTime(long expireTime)

isEof

public boolean isEof()
              throws java.io.IOException
Throws:
java.io.IOException

getStream

public abstract StreamImpl getStream()
                              throws java.io.IOException
Returns a stream impl for the socket encapsulating the input and output stream.

Throws:
java.io.IOException

getTotalReadBytes

public abstract long getTotalReadBytes()
Returns the total number of bytes read from the socket connection.


getTotalWriteBytes

public abstract long getTotalWriteBytes()
Returns the total number of bytes written to the socket connection.


isClosed

public abstract boolean isClosed()
returns true if it's closed.


forceShutdown

public void forceShutdown()

close

public abstract void close()
                    throws java.io.IOException
Throws:
java.io.IOException