| Constructor and Description |
|---|
JniSocketImpl() |
| Modifier and Type | Method and Description |
|---|---|
int |
acceptInitialRead(byte[] buffer,
int offset,
int length)
Initialize new connection from the socket.
|
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 |
isMmapEnabled() |
boolean |
isSecure()
Returns true if the connection is secure.
|
boolean |
isSendfileEnabled() |
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.
|
int |
writeMmap(long mmapAddress,
long[] mmapBlocks,
long mmapOffset,
long mmapLength) |
int |
writeSendfile(byte[] buffer,
int offset,
int length,
byte[] fileName,
int nameLength,
long fileLength) |
closeWrite, getClientCertificates, getSelectableChannel, getSocket, setSocket, setSoTimeout, setTcpNoDelaypublic 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.IOExceptionpublic boolean connectImpl(java.lang.String host,
int port)
throws java.io.IOException
java.io.IOExceptionpublic int acceptInitialRead(byte[] buffer,
int offset,
int length)
acceptInitialRead in class QSocketbuf - the initial bufferoffset - the initial buffer offsetlength - the initial buffer lengthpublic 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 QSocketpublic 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 QSocketpublic int getLocalAddress(byte[] buffer,
int offset,
int length)
public void setSecure(boolean isSecure)
public final boolean isSecure()
public java.lang.String getCipherSuite()
getCipherSuite in class QSocketpublic int getCipherBits()
getCipherBits in class QSocketpublic 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 int read(byte[] buffer,
int offset,
int length,
long timeout)
throws java.io.IOException
java.io.IOExceptionpublic int write(byte[] buffer,
int offset,
int length,
boolean isEnd)
throws java.io.IOException
java.io.IOExceptionpublic boolean isMmapEnabled()
public int writeMmap(long mmapAddress,
long[] mmapBlocks,
long mmapOffset,
long mmapLength)
throws java.io.IOException
java.io.IOExceptionpublic boolean isSendfileEnabled()
public int writeSendfile(byte[] buffer,
int offset,
int length,
byte[] fileName,
int nameLength,
long fileLength)
throws java.io.IOException
java.io.IOExceptionpublic int flush()
throws java.io.IOException
java.io.IOExceptionpublic StreamImpl getStream() throws java.io.IOException
public long getTotalReadBytes()
QSocketgetTotalReadBytes in class QSocketpublic long getTotalWriteBytes()
QSocketgetTotalWriteBytes in class QSocketpublic void forceShutdown()
forceShutdown in class QSocketpublic void close()
throws java.io.IOException
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwable