Class TcpClient


  • public final class TcpClient
    extends java.lang.Object
    A utility to create a TCP clients for tests.
    • Method Detail

      • connectBlocking

        public NettyConnection<Buffer,​Buffer> connectBlocking​(ExecutionContext executionContext,
                                                                    java.net.SocketAddress address)
                                                             throws java.util.concurrent.ExecutionException,
                                                                    java.lang.InterruptedException
        Connect and await for the connection.
        Parameters:
        executionContext - ExecutionContext to use for the connections.
        address - to connect.
        Returns:
        New NettyConnection.
        Throws:
        java.util.concurrent.ExecutionException - If connect failed.
        java.lang.InterruptedException - If interrupted while waiting for connect to complete.
      • connectWithFdBlocking

        public NettyConnection<Buffer,​Buffer> connectWithFdBlocking​(ExecutionContext executionContext,
                                                                          java.net.SocketAddress address)
                                                                   throws java.util.concurrent.ExecutionException,
                                                                          java.lang.InterruptedException
        Connect using a FileDescriptorSocketAddress and await for the connection.
        Parameters:
        executionContext - ExecutionContext to use for the connections.
        address - to connect.
        Returns:
        New NettyConnection.
        Throws:
        java.util.concurrent.ExecutionException - If connect failed.
        java.lang.InterruptedException - If interrupted while waiting for connect to complete.