|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.caucho.vfs.QSocket
com.caucho.vfs.JniSocketImpl
@Module public final class JniSocketImpl
Abstract socket to handle both normal sockets and bin/resin sockets.
| Constructor Summary | |
|---|---|
JniSocketImpl()
|
|
| Method Summary | |
|---|---|
void |
close()
Closes the socket. |
static JniSocketImpl |
connect(java.lang.String host,
int port)
|
boolean |
connectImpl(java.lang.String host,
int port)
Creates the new server socket. |
protected void |
finalize()
|
int |
flush()
Flushes the socket. |
void |
forceShutdown()
Closes the socket. |
int |
getCipherBits()
Returns the number of bits in the cipher for an ssl connection. |
java.lang.String |
getCipherSuite()
Returns the cipher for an ssl connection. |
java.security.cert.X509Certificate |
getClientCertificate()
Returns the client certificate. |
long |
getFd()
|
static java.lang.String |
getInitMessage()
|
java.net.InetAddress |
getLocalAddress()
Returns the local server's inet address. |
int |
getLocalAddress(byte[] buffer,
int offset,
int length)
Returns the local server's inet address. |
java.lang.String |
getLocalHost()
Returns the local server's host name. |
int |
getLocalPort()
Returns the server port that accepted the request. |
int |
getNativeFd()
|
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 host name. |
byte[] |
getRemoteIP()
Returns the remote client's inet address. |
int |
getRemotePort()
Returns the remote client's port. |
StreamImpl |
getStream()
Returns a stream impl for the socket encapsulating the input and output 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. |
boolean |
isClosed()
Returns true if closed. |
static boolean |
isEnabled()
|
boolean |
isEof()
Read non-blocking |
boolean |
isSecure()
Returns true if the connection is secure. |
int |
read(byte[] buffer,
int offset,
int length,
long timeout)
Reads from the socket. |
void |
setRequestExpireTime(long expireTime)
Sets the expire time |
void |
setSecure(boolean isSecure)
Set true for secure. |
java.lang.String |
toString()
|
int |
write(byte[] buffer,
int offset,
int length,
boolean isEnd)
Writes to the socket. |
| Methods inherited from class com.caucho.vfs.QSocket |
|---|
getClientCertificates, getSelectableChannel |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public JniSocketImpl()
| Method Detail |
|---|
public static boolean isEnabled()
public static java.lang.String getInitMessage()
public static JniSocketImpl connect(java.lang.String host,
int port)
throws java.io.IOException
java.io.IOException
public boolean connectImpl(java.lang.String host,
int port)
throws java.io.IOException
java.io.IOExceptionpublic long getFd()
public int getNativeFd()
public int getLocalPort()
getLocalPort in class QSocketpublic java.lang.String getRemoteHost()
getRemoteHost in class QSocketpublic java.net.InetAddress getRemoteAddress()
getRemoteAddress in class QSocket
public int getRemoteAddress(byte[] buffer,
int offset,
int length)
getRemoteAddress in class QSocketpublic byte[] getRemoteIP()
getRemoteIP in class QSocketpublic int getRemotePort()
getRemotePort in class QSocketpublic java.lang.String getLocalHost()
getLocalHost in class QSocketpublic java.net.InetAddress getLocalAddress()
getLocalAddress in class QSocket
public int getLocalAddress(byte[] buffer,
int offset,
int length)
public void setSecure(boolean isSecure)
public final boolean isSecure()
isSecure in class QSocketpublic java.lang.String getCipherSuite()
getCipherSuite in class QSocketpublic int getCipherBits()
getCipherBits in class QSocket
public java.security.cert.X509Certificate getClientCertificate()
throws java.security.cert.CertificateException
getClientCertificate in class QSocketjava.security.cert.CertificateExceptionpublic void setRequestExpireTime(long expireTime)
setRequestExpireTime in class QSocketpublic boolean isEof()
isEof in class QSocket
public int read(byte[] buffer,
int offset,
int length,
long timeout)
throws java.io.IOException
java.io.IOException
public int write(byte[] buffer,
int offset,
int length,
boolean isEnd)
throws java.io.IOException
java.io.IOException
public int flush()
throws java.io.IOException
java.io.IOException
public StreamImpl getStream()
throws java.io.IOException
getStream in class QSocketjava.io.IOExceptionpublic long getTotalReadBytes()
QSocket
getTotalReadBytes in class QSocketpublic long getTotalWriteBytes()
QSocket
getTotalWriteBytes in class QSocketpublic boolean isClosed()
isClosed in class QSocketpublic void forceShutdown()
forceShutdown in class QSocket
public void close()
throws java.io.IOException
close in class QSocketjava.io.IOException
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwablepublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||