Class PTCPServerSocket
java.lang.Object
ecmwf.common.transport.ptcp.psocket.PTCPServerSocket
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The Constant DATA_SOCKET.static final int
The Constant NORMAL_SOCKET.static final int
The Constant PTCP_SOCKET. -
Constructor Summary
ConstructorsConstructorDescriptionPTCPServerSocket
(int port) Instantiates a new PTCP server socket.PTCPServerSocket
(int port, int backlog) Instantiates a new PTCP server socket.PTCPServerSocket
(int port, int backlog, InetAddress bindAddr) Instantiates a new PTCP server socket.PTCPServerSocket
(ServerSocket serverSocket) Instantiates a new PTCP server socket. -
Method Summary
Modifier and TypeMethodDescriptionaccept()
This returns a PSocket that connected to client.void
close()
Close.void
close
(boolean serverSocketOnly) Close.int
Gets the local port.static byte[]
Gets the normal socket header.void
setSoTimeout
(int timeout) Sets the so timeout.
-
Field Details
-
PTCP_SOCKET
public static final int PTCP_SOCKETThe Constant PTCP_SOCKET.- See Also:
-
DATA_SOCKET
public static final int DATA_SOCKETThe Constant DATA_SOCKET.- See Also:
-
NORMAL_SOCKET
public static final int NORMAL_SOCKETThe Constant NORMAL_SOCKET.- See Also:
-
-
Constructor Details
-
PTCPServerSocket
Instantiates a new PTCP server socket.- Parameters:
serverSocket
- the server socket- Throws:
IOException
- Signals that an I/O exception has occurred.
-
PTCPServerSocket
Instantiates a new PTCP server socket.- Parameters:
port
- the port- Throws:
IOException
- Signals that an I/O exception has occurred.
-
PTCPServerSocket
Instantiates a new PTCP server socket.- Parameters:
port
- the portbacklog
- the backlog- Throws:
IOException
- Signals that an I/O exception has occurred.
-
PTCPServerSocket
Instantiates a new PTCP server socket.- Parameters:
port
- the portbacklog
- the backlogbindAddr
- the bind addr- Throws:
IOException
- Signals that an I/O exception has occurred.
-
-
Method Details
-
setSoTimeout
Sets the so timeout.- Parameters:
timeout
- the new so timeout- Throws:
SocketException
- the socket exception
-
getLocalPort
public int getLocalPort()Gets the local port.- Returns:
- the local port
-
getNormalSocketHeader
Gets the normal socket header.- Returns:
- the normal socket header
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
accept
This returns a PSocket that connected to client.- Returns:
- the socket
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
close
Close.- Parameters:
serverSocketOnly
- the server socket only- Throws:
IOException
- Signals that an I/O exception has occurred.
-
close
Close.- Throws:
IOException
- Signals that an I/O exception has occurred.
-