org.apache.thrift.transport

## Class TServerSocket

- java.lang.Object
- - org.apache.thrift.transport.TServerTransport
  - - org.apache.thrift.transport.TServerSocket

-     public class TServerSocket
      extends TServerTransport

  Wrapper around ServerSocket for Thrift.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TServerSocket(java.net.InetSocketAddress bindAddr)`
    `TServerSocket(java.net.InetSocketAddress bindAddr, int clientTimeout)`
    `TServerSocket(int port)` Creates just a port listening server socket
    `TServerSocket(int port, int clientTimeout)` Creates just a port listening server socket
    `TServerSocket(java.net.ServerSocket serverSocket)` Creates a server socket from underlying socket object
    `TServerSocket(java.net.ServerSocket serverSocket, int clientTimeout)` Creates a server socket from underlying socket object

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected TSocket` | `acceptImpl()`
    `void` | `close()`
    `java.net.ServerSocket` | `getServerSocket()`
    `void` | `interrupt()` Optional method implementation.
    `void` | `listen()`

    - ### Methods inherited from class org.apache.thrift.transport.TServerTransport

      `accept`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TServerSocket

          public TServerSocket(java.net.ServerSocket serverSocket)

      Creates a server socket from underlying socket object

    - #### TServerSocket

          public TServerSocket(java.net.ServerSocket serverSocket,
                       int clientTimeout)

      Creates a server socket from underlying socket object

    - #### TServerSocket

          public TServerSocket(int port)
                        throws TTransportException

      Creates just a port listening server socket
      Throws:
        `TTransportException`

    - #### TServerSocket

          public TServerSocket(int port,
                       int clientTimeout)
                        throws TTransportException

      Creates just a port listening server socket
      Throws:
        `TTransportException`

    - #### TServerSocket

          public TServerSocket(java.net.InetSocketAddress bindAddr)
                        throws TTransportException

      Throws:
        `TTransportException`

    - #### TServerSocket

          public TServerSocket(java.net.InetSocketAddress bindAddr,
                       int clientTimeout)
                        throws TTransportException

      Throws:
        `TTransportException`

  - ### Method Detail

    - #### listen

          public void listen()
                      throws TTransportException

      Specified by:
        `listen` in class `TServerTransport`
      Throws:
        `TTransportException`

    - #### acceptImpl

          protected TSocket acceptImpl()
                                throws TTransportException

      Specified by:
        `acceptImpl` in class `TServerTransport`
      Throws:
        `TTransportException`

    - #### close

          public void close()

      Specified by:
        `close` in class `TServerTransport`

    - #### interrupt

          public void interrupt()

      Description copied from class: `TServerTransport`
      Optional method implementation. This signals to the server transport that it should break out of any accept() or listen() that it is currently blocked on. This method, if implemented, MUST be thread safe, as it may be called from a different thread context than the other TServerTransport methods.
      Overrides:
        `interrupt` in class `TServerTransport`

    - #### getServerSocket

          public java.net.ServerSocket getServerSocket()