类 Reactor2TcpClient<P>

    • 构造器详细资料

      • Reactor2TcpClient

        public Reactor2TcpClient​(String host,
                                 int port,
                                 reactor.io.codec.Codec<reactor.io.buffer.Buffer,​Message<P>,​Message<P>> codec)
        A constructor that creates a TcpClientSpec factory with a default SynchronousDispatcher, i.e. relying on Netty threads. The number of Netty threads can be tweaked with the reactor.tcp.ioThreadCount System property. The network I/O threads will be shared amongst the active clients.
        参数:
        host - the host to connect to
        port - the port to connect to
        codec - the codec to use for encoding and decoding the TCP stream
      • Reactor2TcpClient

        public Reactor2TcpClient​(reactor.fn.Supplier<InetSocketAddress> addressSupplier,
                                 reactor.io.codec.Codec<reactor.io.buffer.Buffer,​Message<P>,​Message<P>> codec)
        A variant of Reactor2TcpClient(String, int, Codec) that takes a supplier of any number of addresses instead of just one host and port. This can be used to reconnect to a different address after the current host becomes unavailable.
        参数:
        addressSupplier - supplier of addresses to use for connecting
        codec - the codec to use for encoding and decoding the TCP stream
        从以下版本开始:
        4.3.15
      • Reactor2TcpClient

        public Reactor2TcpClient​(reactor.io.net.NetStreams.TcpClientFactory<Message<P>,​Message<P>> tcpClientSpecFactory)
        A constructor with a pre-configured Spec.TcpClientSpecFunction factory. This might be used to add SSL or specific network parameters to the generated client configuration.

        NOTE: if the client is configured with a thread-creating dispatcher, you are responsible for cleaning them, e.g. via Resource.shutdown().

        参数:
        tcpClientSpecFactory - the TcpClientSpec Function to use for each client creation