@NotNull
  @Override
  public ChannelFuture send(@NotNull ByteBuf message) {
    if (channel.isOpen()) {
      ByteBuf lengthBuffer = channel.alloc().ioBuffer(4);
      lengthBuffer.writeInt(message.readableBytes());
      channel.write(lengthBuffer);
      return channel.writeAndFlush(message);
    }
    else {
      return channel.newFailedFuture(new ClosedChannelException());
    }
  }
@NotNull
  @Override
  public ChannelFuture send(@NotNull ByteBuf message)