com.caucho.vfs
Class JniServerSocketImpl

java.lang.Object
  extended by com.caucho.vfs.QServerSocket
      extended by com.caucho.vfs.JniServerSocketImpl

public class JniServerSocketImpl
extends QServerSocket

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


Method Summary
 boolean accept(QSocket socket)
          Accepts a new connection from the socket.
 void close()
          Closes the socket.
static QServerSocket create(java.lang.String host, int port)
           
 QSocket createSocket()
          Factory method creating an instance socket.
 void finalize()
           
 long getFd()
          Returns the file descriptor to OpenSSLFactory.
static java.lang.String getInitMessage()
           
 java.net.InetAddress getLocalAddress()
           
 int getLocalPort()
           
 int getSystemFD()
           
 boolean isClosed()
           
static boolean isEnabled()
           
 boolean isJni()
          Returns true if this is a JNI socket, to distinguish between file-descriptors we have extra control over.
 boolean isJniValid()
           
 void listen(int backlog)
          Sets the socket's listen backlog.
static QServerSocket open(int fd, int port)
           
 void setConnectionSocketTimeout(int ms)
          Sets the connection read timeout.
 boolean setSaveOnExec()
           
 void setTcpKeepalive(boolean isEnable)
          Sets the connection tcp-keepalivedelay.
 void setTcpNoDelay(boolean isEnable)
          Sets the connection tcp-no-delay.
 java.lang.String toString()
           
 
Methods inherited from class com.caucho.vfs.QServerSocket
getSelector, isTcpKeepalive, isTcpNoDelay
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

isEnabled

public static boolean isEnabled()

getInitMessage

public static java.lang.String getInitMessage()

getFd

public long getFd()
Returns the file descriptor to OpenSSLFactory. No other classes may use the file descriptor.


isJni

public boolean isJni()
Returns true if this is a JNI socket, to distinguish between file-descriptors we have extra control over.

Overrides:
isJni in class QServerSocket

isJniValid

public boolean isJniValid()

setSaveOnExec

public boolean setSaveOnExec()
Overrides:
setSaveOnExec in class QServerSocket

getSystemFD

public int getSystemFD()
Overrides:
getSystemFD in class QServerSocket

listen

public void listen(int backlog)
Sets the socket's listen backlog.

Overrides:
listen in class QServerSocket

create

public static QServerSocket create(java.lang.String host,
                                   int port)
                            throws java.io.IOException
Throws:
java.io.IOException

open

public static QServerSocket open(int fd,
                                 int port)
                          throws java.io.IOException
Throws:
java.io.IOException

setConnectionSocketTimeout

public void setConnectionSocketTimeout(int ms)
Sets the connection read timeout.

Specified by:
setConnectionSocketTimeout in class QServerSocket

setTcpNoDelay

public void setTcpNoDelay(boolean isEnable)
Sets the connection tcp-no-delay.

Overrides:
setTcpNoDelay in class QServerSocket

setTcpKeepalive

public void setTcpKeepalive(boolean isEnable)
Sets the connection tcp-keepalivedelay.

Overrides:
setTcpKeepalive in class QServerSocket

accept

public boolean accept(QSocket socket)
               throws java.io.IOException
Accepts a new connection from the socket.

Specified by:
accept in class QServerSocket
Parameters:
socket - the socket connection structure
Returns:
true if the accept returns a new socket.
Throws:
java.io.IOException

createSocket

public QSocket createSocket()
                     throws java.io.IOException
Factory method creating an instance socket.

Specified by:
createSocket in class QServerSocket
Throws:
java.io.IOException

getLocalAddress

public java.net.InetAddress getLocalAddress()
Specified by:
getLocalAddress in class QServerSocket

getLocalPort

public int getLocalPort()
Specified by:
getLocalPort in class QServerSocket

isClosed

public boolean isClosed()
Overrides:
isClosed in class QServerSocket

close

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

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

toString

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

finalize

public void finalize()
              throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable