|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.net.Socket
cgl.narada.transport.ptcp.psocket.PTCPSocket
public class PTCPSocket
Title:
Description:
Copyright: Copyright (c) 2004
Company:
| Field Summary |
|---|
| Fields inherited from interface cgl.narada.transport.ptcp.psocket.tools.PTCPParameters |
|---|
COMM_SOCKET, DATA_SOCKET, PTCPBuffer_Debug, PTCPDataFragmentator_Debug, PTCPInputStream_Debug, PTCPOutputStream_Debug, PTCPPacket_Debug, PTCPReceiverWorker_Debug, PTCPSenderWorker_Debug, PTCPServerSocket_Debug, PTCPSocket_Debug, PTCPSocketInfo_Debug |
| Constructor Summary | |
|---|---|
PTCPSocket(InetAddress address,
int port,
InetAddress localAddr,
int localPort,
int num)
creates a socket and connects it to the specified remote address on the specified remote port. |
|
PTCPSocket(InetAddress address,
int port,
InetAddress localAddr,
int localPort,
int num,
boolean incPrf)
|
|
PTCPSocket(InetAddress address,
int port,
int num)
Constructor. |
|
PTCPSocket(InetAddress address,
int port,
int num,
boolean incPrf)
|
|
PTCPSocket(int num)
|
|
PTCPSocket(int num,
boolean incPrf)
|
|
PTCPSocket(String host,
int port,
InetAddress localAddr,
int localPort,
int num)
Creates a socket and connects it to the specified remote host on the specified remote port. |
|
PTCPSocket(String host,
int port,
InetAddress localAddr,
int localPort,
int num,
boolean incPrf)
|
|
PTCPSocket(String host,
int port,
int num)
Constructor. |
|
PTCPSocket(String host,
int port,
int num,
boolean incPrf)
|
|
| Method Summary | |
|---|---|
void |
addSocket(Socket[] sockets)
|
void |
addSocket(Socket[] sockets,
Socket commSock)
|
InputStream |
getCommInputStream()
Get input stream for commands. |
OutputStream |
getCommOutputStream()
Get output stream for commands. |
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 |
getNumberOfStreams()
|
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 |
getRTT()
|
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. |
long |
getTxEndTime()
|
long |
getTxStartTime()
|
boolean |
isConnected()
Returns the connection state of the socket. |
boolean |
isIncrPerf()
|
void |
setIncreasePerformanceOption()
|
void |
setIncrPerf(boolean incrPerf)
|
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 |
setRTT(int rtt)
|
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 |
setTxEndTime(long txEndTime)
|
void |
setTxStartTime(long txStartTime)
|
void |
shutdownInput()
Places the input stream for this socket at "end of stream". |
void |
shutdownOutput()
Disables the output stream for this socket. |
String |
toString()
Converts this socket to a String. |
| Methods inherited from class java.net.Socket |
|---|
bind, close, connect, connect, getChannel, getLocalSocketAddress, getOOBInline, getRemoteSocketAddress, getReuseAddress, getTrafficClass, isBound, isClosed, isInputShutdown, isOutputShutdown, sendUrgentData, setOOBInline, setPerformancePreferences, setReuseAddress, setSocketImplFactory, setTrafficClass |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PTCPSocket(int num)
public PTCPSocket(int num,
boolean incPrf)
public PTCPSocket(String host,
int port,
int num)
host - remote host name.port - remote server port.num - number of parallel streams.
public PTCPSocket(String host,
int port,
int num,
boolean incPrf)
public PTCPSocket(InetAddress address,
int port,
int num)
address - remote internet address.port - remote server port.num - number of parallel streams.
public PTCPSocket(InetAddress address,
int port,
int num,
boolean incPrf)
public PTCPSocket(String host,
int port,
InetAddress localAddr,
int localPort,
int num)
public PTCPSocket(String host,
int port,
InetAddress localAddr,
int localPort,
int num,
boolean incPrf)
public PTCPSocket(InetAddress address,
int port,
InetAddress localAddr,
int localPort,
int num)
public PTCPSocket(InetAddress address,
int port,
InetAddress localAddr,
int localPort,
int num,
boolean incPrf)
| Method Detail |
|---|
public InputStream getCommInputStream()
throws IOException
IOException
public OutputStream getCommOutputStream()
throws IOException
IOExceptionpublic InetAddress getInetAddress()
getInetAddress in class Socket
public InputStream getInputStream()
throws IOException
getInputStream in class SocketIOException
public void setKeepAlive(boolean on)
throws SocketException
setKeepAlive in class SocketSocketException
public boolean getKeepAlive()
throws SocketException
getKeepAlive in class SocketSocketExceptionpublic InetAddress getLocalAddress()
getLocalAddress in class Socketpublic int getLocalPort()
getLocalPort in class Socket
public OutputStream getOutputStream()
throws IOException
getOutputStream in class SocketIOExceptionpublic int getPort()
getPort in class Socketpublic void setRTT(int rtt)
public int getRTT()
public void setReceiveBufferSize(int size)
setReceiveBufferSize in class Socketpublic int getReceiveBufferSize()
getReceiveBufferSize in class Socket
public void setSendBufferSize(int size)
throws SocketException
setSendBufferSize in class SocketSocketException
public int getSendBufferSize()
throws SocketException
getSendBufferSize in class SocketSocketException
public void setSoLinger(boolean on,
int linger)
throws SocketException
setSoLinger in class SocketSocketException
public int getSoLinger()
throws SocketException
getSoLinger in class SocketSocketExceptionpublic void setIncreasePerformanceOption()
public void setSoTimeout(int timeout)
throws SocketException
setSoTimeout in class SocketSocketException
public int getSoTimeout()
throws SocketException
getSoTimeout in class SocketSocketException
public void setTcpNoDelay(boolean on)
throws SocketException
setTcpNoDelay in class SocketSocketException
public boolean getTcpNoDelay()
throws SocketException
getTcpNoDelay in class SocketSocketExceptionpublic void setTxEndTime(long txEndTime)
public long getTxEndTime()
public void setTxStartTime(long txStartTime)
public long getTxStartTime()
public void addSocket(Socket[] sockets)
public void addSocket(Socket[] sockets,
Socket commSock)
public void shutdownInput()
throws IOException
shutdownInput in class SocketIOException
public void shutdownOutput()
throws IOException
shutdownOutput in class SocketIOExceptionpublic String toString()
toString in class Socketpublic boolean isConnected()
isConnected in class Socketpublic boolean isIncrPerf()
public void setIncrPerf(boolean incrPerf)
public int getNumberOfStreams()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||