Class NioClient

    • Constructor Detail

      • NioClient

        public NioClient​(java.net.SocketAddress serverAddress,
                         StreamConnection parser,
                         java.time.Duration connectTimeout)
                  throws java.io.IOException

        Creates a new client to the given server address using the given StreamConnection to decode the data. The given connection MUST be unique to this object. This does not block while waiting for the connection to open, but will call either the StreamConnection.connectionOpened() or StreamConnection.connectionClosed() callback on the created network event processing thread.

        Parameters:
        serverAddress - socket address of the server to connect to
        parser - parses data from the server
        connectTimeout - timeout for establishing a connection to the server, or ZERO for no timeout
        Throws:
        java.io.IOException