private void disconnect(
      final ChannelHandlerContext ctx, final DisconnectMessage.DisconnectReason reason) {
    ctx.writeAndFlush(new OutboundMessage(null, DisconnectMessage.create(reason)))
        .addListener(
            ff -> {
              ctx.close();
              connectionFuture.completeExceptionally(
                  new IllegalStateException("Disconnecting from peer: " + reason.name()));
            });
  }
Generates the next message in the handshake sequence.

@param msg Incoming Message
@return Optional of the next Handshake message that needs to be returned to the peer
ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/connections/netty/AbstractHandshakeHandler.java