void dumpState(final StringBuilder b) { synchronized (remoteConnection.getLock()) { final int state = this.channelState; final boolean sentCloseReq = Bits.allAreSet(state, SENT_CLOSE_REQ); final boolean receivedCloseReq = Bits.allAreSet(state, RECEIVED_CLOSE_REQ); final int inboundChannels = (state & INBOUND_CHANNELS_MASK) >>> Integer.numberOfTrailingZeros(ONE_INBOUND_CHANNEL); final int outboundChannels = (state & OUTBOUND_CHANNELS_MASK) >>> Integer.numberOfTrailingZeros(ONE_OUTBOUND_CHANNEL); final Connection connection = remoteConnection.getConnection(); final SocketAddress localAddress = connection.getLocalAddress(); final SocketAddress peerAddress = connection.getPeerAddress(); b.append(" ").append("Connection ").append(localAddress).append(" <-> ").append(peerAddress).append('\n'); b.append(" ").append("Raw: ").append(connection).append('\n'); b.append(" ").append("* Flags: "); if (Bits.allAreSet(behavior, Protocol.BH_MESSAGE_CLOSE)) b.append("supports-message-close "); if (Bits.allAreSet(behavior, Protocol.BH_FAULTY_MSG_SIZE)) b.append("remote-faulty-message-size "); if (supportsRemoteAuth) b.append("auth-cap "); if (receivedCloseReq) b.append("received-close-req "); if (sentCloseReq) b.append("set-close-req "); b.append('\n'); b.append(" ").append("* ").append(inboundChannels).append(" (max ").append(maxInboundChannels).append(") inbound channels\n"); b.append(" ").append("* ").append(outboundChannels).append(" (max ").append(maxOutboundChannels).append(") outbound channels\n"); b.append(" ").append("* Channels:\n"); for (RemoteConnectionChannel connectionChannel : channels) { connectionChannel.dumpState(b); } } } }
void dumpState(final StringBuilder b) { synchronized (remoteConnection.getLock()) { final int state = this.channelState; final boolean sentCloseReq = Bits.allAreSet(state, SENT_CLOSE_REQ); final boolean receivedCloseReq = Bits.allAreSet(state, RECEIVED_CLOSE_REQ); final int inboundChannels = (state & INBOUND_CHANNELS_MASK) >>> Integer.numberOfTrailingZeros(ONE_INBOUND_CHANNEL); final int outboundChannels = (state & OUTBOUND_CHANNELS_MASK) >>> Integer.numberOfTrailingZeros(ONE_OUTBOUND_CHANNEL); final ConnectedMessageChannel channel = remoteConnection.getChannel(); final SocketAddress localAddress = channel.getLocalAddress(); final SocketAddress peerAddress = channel.getPeerAddress(); b.append(" ").append("Connection ").append(localAddress).append(" <-> ").append(peerAddress).append('\n'); b.append(" ").append("Channel: ").append(channel).append('\n'); b.append(" ").append("* Flags: "); if (Bits.allAreSet(behavior, Protocol.BH_MESSAGE_CLOSE)) b.append("supports-message-close "); if (Bits.allAreSet(behavior, Protocol.BH_FAULTY_MSG_SIZE)) b.append("remote-faulty-message-size "); if (receivedCloseReq) b.append("received-close-req "); if (sentCloseReq) b.append("set-close-req "); b.append('\n'); b.append(" ").append("* ").append(inboundChannels).append(" (max ").append(maxInboundChannels).append(") inbound channels\n"); b.append(" ").append("* ").append(outboundChannels).append(" (max ").append(maxOutboundChannels).append(") outbound channels\n"); b.append(" ").append("* Channels:\n"); for (RemoteConnectionChannel connectionChannel : channels) { connectionChannel.dumpState(b); } } } }
void dumpState(final StringBuilder b) { synchronized (remoteConnection.getLock()) { final int state = this.channelState; final boolean sentCloseReq = Bits.allAreSet(state, SENT_CLOSE_REQ); final boolean receivedCloseReq = Bits.allAreSet(state, RECEIVED_CLOSE_REQ); final int inboundChannels = (state & INBOUND_CHANNELS_MASK) >>> Integer.numberOfTrailingZeros(ONE_INBOUND_CHANNEL); final int outboundChannels = (state & OUTBOUND_CHANNELS_MASK) >>> Integer.numberOfTrailingZeros(ONE_OUTBOUND_CHANNEL); final Connection connection = remoteConnection.getConnection(); final SocketAddress localAddress = connection.getLocalAddress(); final SocketAddress peerAddress = connection.getPeerAddress(); b.append(" ").append("Connection ").append(localAddress).append(" <-> ").append(peerAddress).append('\n'); b.append(" ").append("Raw: ").append(connection).append('\n'); b.append(" ").append("* Flags: "); if (Bits.allAreSet(behavior, Protocol.BH_MESSAGE_CLOSE)) b.append("supports-message-close "); if (Bits.allAreSet(behavior, Protocol.BH_FAULTY_MSG_SIZE)) b.append("remote-faulty-message-size "); if (supportsRemoteAuth) b.append("auth-cap "); if (receivedCloseReq) b.append("received-close-req "); if (sentCloseReq) b.append("set-close-req "); b.append('\n'); b.append(" ").append("* ").append(inboundChannels).append(" (max ").append(maxInboundChannels).append(") inbound channels\n"); b.append(" ").append("* ").append(outboundChannels).append(" (max ").append(maxOutboundChannels).append(") outbound channels\n"); b.append(" ").append("* Channels:\n"); for (RemoteConnectionChannel connectionChannel : channels) { connectionChannel.dumpState(b); } } } }