Class PTCPServerSocket

java.lang.Object
ecmwf.common.transport.ptcp.psocket.PTCPServerSocket

public class PTCPServerSocket extends Object
The Class PTCPServerSocket.
  • Field Details

    • PTCP_SOCKET

      public static final int PTCP_SOCKET
      The Constant PTCP_SOCKET.
      See Also:
    • DATA_SOCKET

      public static final int DATA_SOCKET
      The Constant DATA_SOCKET.
      See Also:
    • NORMAL_SOCKET

      public static final int NORMAL_SOCKET
      The Constant NORMAL_SOCKET.
      See Also:
  • Constructor Details

    • PTCPServerSocket

      public PTCPServerSocket(ServerSocket serverSocket) throws IOException
      Instantiates a new PTCP server socket.
      Parameters:
      serverSocket - the server socket
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • PTCPServerSocket

      public PTCPServerSocket(int port) throws IOException
      Instantiates a new PTCP server socket.
      Parameters:
      port - the port
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • PTCPServerSocket

      public PTCPServerSocket(int port, int backlog) throws IOException
      Instantiates a new PTCP server socket.
      Parameters:
      port - the port
      backlog - the backlog
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • PTCPServerSocket

      public PTCPServerSocket(int port, int backlog, InetAddress bindAddr) throws IOException
      Instantiates a new PTCP server socket.
      Parameters:
      port - the port
      backlog - the backlog
      bindAddr - the bind addr
      Throws:
      IOException - Signals that an I/O exception has occurred.
  • Method Details

    • setSoTimeout

      public void setSoTimeout(int timeout) throws SocketException
      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

      public static byte[] getNormalSocketHeader() throws IOException
      Gets the normal socket header.
      Returns:
      the normal socket header
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • accept

      public Socket accept() throws IOException
      This returns a PSocket that connected to client.
      Returns:
      the socket
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • close

      public void close(boolean serverSocketOnly) throws IOException
      Close.
      Parameters:
      serverSocketOnly - the server socket only
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • close

      public void close() throws IOException
      Close.
      Throws:
      IOException - Signals that an I/O exception has occurred.