Class TcpConnection


  • public class TcpConnection
    extends Connection
    Since:
    2018-02-21
    • Constructor Detail

      • TcpConnection

        public TcpConnection()
    • Method Detail

      • connect

        public void connect​(java.net.InetSocketAddress endPoint,
                            int timeout)
        Description copied from class: Connection
        Connects to the specified end point.
        Specified by:
        connect in class Connection
        Parameters:
        endPoint - The end point to connect to.
        timeout - Timeout in milliseconds
      • disconnect

        public void disconnect()
        Description copied from class: Connection
        Disconnects this instance.
        Specified by:
        disconnect in class Connection
      • send

        public void send​(byte[] data)
        Description copied from class: Connection
        Sends the specified data packet.
        Specified by:
        send in class Connection
        Parameters:
        data - The data packet to send.
      • getLocalIP

        public java.net.InetAddress getLocalIP()
        Description copied from class: Connection
        Gets the local IP.
        Specified by:
        getLocalIP in class Connection
        Returns:
        The local IP.