public class PBaseSocket extends Socket
| Modifier and Type | Field and Description |
|---|---|
protected int |
id_
Internal ID number assigned by server
|
protected int |
numStreams_
Number of streams.
|
protected Socket[] |
sockets_
Internal stream sockets.
|
| Constructor and Description |
|---|
PBaseSocket(byte[] key,
boolean compress) |
| Modifier and Type | Method and Description |
|---|---|
InetAddress |
getInetAddress()
Returns the address to which the socket is connected.
|
InputStream |
getInputStream()
Returns an input stream for this socket.
|
boolean |
getKeepAlive()
Tests if SO_KEEPALIVE is enabled.
|
InetAddress |
getLocalAddress()
Gets the local address to which the socket is bound.
|
int |
getLocalPort()
Returns the local port to which this socket is bound.
|
int |
getNumStreams()
Return number of parallel streams.
|
OutputStream |
getOutputStream()
Returns an output stream for this socket.
|
int |
getPort()
Returns the remote port to which this socket is connected.
|
int |
getReceiveBufferSize()
Gets the value of the SO_RCVBUF option for this Socket, that is the
buffer size used by the platform for input on this Socket.
|
int |
getSendBufferSize()
Get value of the SO_SNDBUF option for this Socket, that is the buffer
size used by the platform for output on this Socket.
|
int |
getSoLinger()
Returns setting for SO_LINGER.
|
int |
getSoTimeout()
Returns setting for SO_TIMEOUT.
|
boolean |
getTcpNoDelay()
Tests if TCP_NODELAY is enabled.
|
void |
setKeepAlive(boolean on)
Enable/disable SO_KEEPALIVE.
|
void |
setReceiveBufferSize(int size)
Sets the SO_RCVBUF option to the specified value for this Socket.
|
void |
setSendBufferSize(int size)
Sets the SO_SNDBUF option to the specified value for this Socket.
|
void |
setSoLinger(boolean on,
int linger)
Enable/disable SO_LINGER with the specified linger time in seconds.
|
void |
setSoTimeout(int timeout)
Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds.
|
void |
setTcpNoDelay(boolean on)
Enable/disable TCP_NODELAY (disable/enable Nagle's algorithm).
|
void |
shutdownInput()
Places the input stream for this socket at "end of stream".
|
void |
shutdownOutput()
Disables the output stream for this socket.
|
bind, close, connect, connect, getChannel, getLocalSocketAddress, getOOBInline, getRemoteSocketAddress, getReuseAddress, getTrafficClass, isBound, isClosed, isConnected, isInputShutdown, isOutputShutdown, sendUrgentData, setOOBInline, setPerformancePreferences, setReuseAddress, setSocketImplFactory, setTrafficClass, toStringprotected int id_
protected Socket[] sockets_
protected int numStreams_
public int getNumStreams()
public InputStream getInputStream() throws IOException
getInputStream in class SocketIOExceptionpublic OutputStream getOutputStream() throws IOException
getOutputStream in class SocketIOExceptionpublic InetAddress getInetAddress()
getInetAddress in class Socketpublic InetAddress getLocalAddress()
getLocalAddress in class Socketpublic int getPort()
public int getLocalPort()
getLocalPort in class Socketpublic void setTcpNoDelay(boolean on)
throws SocketException
setTcpNoDelay in class SocketSocketExceptionpublic boolean getTcpNoDelay()
throws SocketException
getTcpNoDelay in class SocketSocketExceptionpublic void setSoLinger(boolean on,
int linger)
throws SocketException
setSoLinger in class SocketSocketExceptionpublic int getSoLinger()
throws SocketException
getSoLinger in class SocketSocketExceptionpublic void setSoTimeout(int timeout)
throws SocketException
setSoTimeout in class SocketSocketExceptionpublic int getSoTimeout()
throws SocketException
getSoTimeout in class SocketSocketExceptionpublic void setSendBufferSize(int size)
throws SocketException
setSendBufferSize in class SocketSocketExceptionpublic int getSendBufferSize()
throws SocketException
getSendBufferSize in class SocketSocketExceptionpublic void setReceiveBufferSize(int size)
throws SocketException
setReceiveBufferSize in class SocketSocketExceptionpublic int getReceiveBufferSize()
throws SocketException
getReceiveBufferSize in class SocketSocketExceptionpublic void setKeepAlive(boolean on)
throws SocketException
setKeepAlive in class SocketSocketExceptionpublic boolean getKeepAlive()
throws SocketException
getKeepAlive in class SocketSocketExceptionpublic void shutdownInput()
throws IOException
shutdownInput in class SocketIOExceptionpublic void shutdownOutput()
throws IOException
shutdownOutput in class SocketIOExceptionCopyright © 2010–2016 UNICORE. All rights reserved.