@Override public final void handshake(final Peer peer) throws IOException, HandshakeException { if (handshakeCompleted) { throw new IllegalStateException("Handshake has already been completed"); } if (shutdown) { throw new IllegalStateException("Protocol is shutdown"); } logger.debug("{} Handshaking with {}", this, peer); this.handshakeProperties = doHandshake(peer); logger.debug("{} Finished handshake with {}", this, peer); handshakeCompleted = true; }
@Override public final void handshake(final Peer peer) throws IOException, HandshakeException { if (handshakeCompleted) { throw new IllegalStateException("Handshake has already been completed"); } if (shutdown) { throw new IllegalStateException("Protocol is shutdown"); } logger.debug("{} Handshaking with {}", this, peer); this.handshakeProperties = doHandshake(peer); logger.debug("{} Finished handshake with {}", this, peer); handshakeCompleted = true; }