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, toString
protected int id_
protected Socket[] sockets_
protected int numStreams_
public int getNumStreams()
public InputStream getInputStream() throws IOException
getInputStream
in class Socket
IOException
public OutputStream getOutputStream() throws IOException
getOutputStream
in class Socket
IOException
public InetAddress getInetAddress()
getInetAddress
in class Socket
public InetAddress getLocalAddress()
getLocalAddress
in class Socket
public int getPort()
public int getLocalPort()
getLocalPort
in class Socket
public void setTcpNoDelay(boolean on) throws SocketException
setTcpNoDelay
in class Socket
SocketException
public boolean getTcpNoDelay() throws SocketException
getTcpNoDelay
in class Socket
SocketException
public void setSoLinger(boolean on, int linger) throws SocketException
setSoLinger
in class Socket
SocketException
public int getSoLinger() throws SocketException
getSoLinger
in class Socket
SocketException
public void setSoTimeout(int timeout) throws SocketException
setSoTimeout
in class Socket
SocketException
public int getSoTimeout() throws SocketException
getSoTimeout
in class Socket
SocketException
public void setSendBufferSize(int size) throws SocketException
setSendBufferSize
in class Socket
SocketException
public int getSendBufferSize() throws SocketException
getSendBufferSize
in class Socket
SocketException
public void setReceiveBufferSize(int size) throws SocketException
setReceiveBufferSize
in class Socket
SocketException
public int getReceiveBufferSize() throws SocketException
getReceiveBufferSize
in class Socket
SocketException
public void setKeepAlive(boolean on) throws SocketException
setKeepAlive
in class Socket
SocketException
public boolean getKeepAlive() throws SocketException
getKeepAlive
in class Socket
SocketException
public void shutdownInput() throws IOException
shutdownInput
in class Socket
IOException
public void shutdownOutput() throws IOException
shutdownOutput
in class Socket
IOException
Copyright © 2010–2016 UNICORE. All rights reserved.