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, setTcpNoDelay
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.IOException
public int acceptInitialRead(byte[] buffer, int offset, int length)
acceptInitialRead
in class QSocket
buf
- the initial bufferoffset
- the initial buffer offsetlength
- the initial buffer lengthpublic long getFd()
public int getNativeFd()
public int getLocalPort()
getLocalPort
in class QSocket
public java.lang.String getRemoteHost()
getRemoteHost
in class QSocket
public java.net.InetAddress getRemoteAddress()
getRemoteAddress
in class QSocket
public int getRemoteAddress(byte[] buffer, int offset, int length)
getRemoteAddress
in class QSocket
public byte[] getRemoteIP()
getRemoteIP
in class QSocket
public int getRemotePort()
getRemotePort
in class QSocket
public java.lang.String getLocalHost()
getLocalHost
in class QSocket
public 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()
public java.lang.String getCipherSuite()
getCipherSuite
in class QSocket
public int getCipherBits()
getCipherBits
in class QSocket
public java.security.cert.X509Certificate getClientCertificate() throws java.security.cert.CertificateException
getClientCertificate
in class QSocket
java.security.cert.CertificateException
public void setRequestExpireTime(long expireTime)
setRequestExpireTime
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 boolean isMmapEnabled()
public int writeMmap(long mmapAddress, long[] mmapBlocks, long mmapOffset, long mmapLength) throws java.io.IOException
java.io.IOException
public boolean isSendfileEnabled()
public int writeSendfile(byte[] buffer, int offset, int length, byte[] fileName, int nameLength, long fileLength) throws java.io.IOException
java.io.IOException
public int flush() throws java.io.IOException
java.io.IOException
public StreamImpl getStream() throws java.io.IOException
public long getTotalReadBytes()
QSocket
getTotalReadBytes
in class QSocket
public long getTotalWriteBytes()
QSocket
getTotalWriteBytes
in class QSocket
public void forceShutdown()
forceShutdown
in class QSocket
public void close() throws java.io.IOException
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable