Class TSocket


  • public class TSocket
    extends TIOStreamTransport
    Socket implementation of the TTransport interface. To be commented soon!
    • Constructor Summary

      Constructors 
      Constructor Description
      TSocket​(java.lang.String host, int port)
      Creates a new unconnected socket that will connect to the given host on the given port.
      TSocket​(java.lang.String host, int port, int timeout)
      Creates a new unconnected socket that will connect to the given host on the given port.
      TSocket​(java.net.Socket socket)
      Constructor that takes an already created socket.
    • Constructor Detail

      • TSocket

        public TSocket​(java.net.Socket socket)
                throws TTransportException
        Constructor that takes an already created socket.
        Parameters:
        socket - Already created socket object
        Throws:
        TTransportException - if there is an error setting up the streams
      • TSocket

        public TSocket​(java.lang.String host,
                       int port)
        Creates a new unconnected socket that will connect to the given host on the given port.
        Parameters:
        host - Remote host
        port - Remote port
      • TSocket

        public TSocket​(java.lang.String host,
                       int port,
                       int timeout)
        Creates a new unconnected socket that will connect to the given host on the given port.
        Parameters:
        host - Remote host
        port - Remote port
        timeout - Socket timeout
    • Method Detail

      • setTimeout

        public void setTimeout​(int timeout)
        Sets the socket timeout
        Parameters:
        timeout - Milliseconds timeout
      • getSocket

        public java.net.Socket getSocket()
        Returns a reference to the underlying socket.
      • isOpen

        public boolean isOpen()
        Checks whether the socket is connected.
        Overrides:
        isOpen in class TIOStreamTransport
        Returns:
        true