@Override
    public void toData(final DataOutput out, final SerializationContext context)
        throws IOException {
      super.toData(out, context);

      out.writeInt(messageId);

      final int length = random.nextInt(LARGEST_MESSAGE_BOUND);

      out.writeInt(length);

      final byte[] payload = new byte[length];
      random.nextBytes(payload);

      out.write(payload);

      /*
       * the LongAdder should ensure that we don't introduce any (much)
       * synchronization with other concurrent tasks here
       */
      bytesTransferredAdder.add(length);
    }
Tests one-way P2P messaging between two peers.
Many concurrent tasks compete on the sending side.
The main purpose of the test is to exercise
ByteBufferSharing and friends.

Tests combinations of: conserve-sockets true/false,
TLS on/off, and socket-buffer-size for sender
and receiver both set to the default (and equal)
and set to the sender's buffer twice as big as the
receiver's buffer.
geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/P2PMessagingConcurrencyDUnitTest.java