Пример #1
0
 /**
  * The {@link Codec} to use to encode and decode data.
  *
  * @param codec The codec to use.
  * @return {@literal this}
  */
 public TcpClientSpec<IN, OUT> codec(@Nullable Codec<Buffer, IN, OUT> codec) {
   Assert.isNull(this.codec, "Codec has already been set.");
   this.codec = codec;
   return this;
 }
Пример #2
0
 /**
  * The address to which this client should connect.
  *
  * @param connectAddress The address to connect to.
  * @return {@literal this}
  */
 public TcpClientSpec<IN, OUT> connect(@Nonnull InetSocketAddress connectAddress) {
   Assert.isNull(this.connectAddress, "Connect address is already set.");
   this.connectAddress = connectAddress;
   return this;
 }