@Override public void channelOpen(boolean wasInitiated) { wireParser.setSocketTimeout(0); // Inform the API user that we're done and ready to roll. channelOpenFuture.set(PaymentChannelClientConnection.this); } }, versionSelector);
@Override public void channelOpen(boolean wasInitiated) { wireParser.setSocketTimeout(0); // Inform the API user that we're done and ready to roll. channelOpenFuture.set(PaymentChannelClientConnection.this); } }, versionSelector);
@Override public void channelOpen(boolean wasInitiated) { wireParser.setSocketTimeout(0); // Inform the API user that we're done and ready to roll. channelOpenFuture.set(PaymentChannelClientConnection.this); } });
@Override public void channelOpen(boolean wasInitiated) { wireParser.setSocketTimeout(0); // Inform the API user that we're done and ready to roll. channelOpenFuture.set(PaymentChannelClientConnection.this); } });
@Override public void channelOpen(Sha256Hash contractHash) { socketProtobufHandler.setSocketTimeout(0); eventHandler.channelOpen(contractHash); }
@Override public void channelOpen(Sha256Hash contractHash) { socketProtobufHandler.setSocketTimeout(0); eventHandler.channelOpen(contractHash); }
@Override public void channelOpen(Sha256Hash contractHash) { socketProtobufHandler.setSocketTimeout(0); eventHandler.channelOpen(contractHash); }
@Override public void channelOpen(Sha256Hash contractHash) { socketProtobufHandler.setSocketTimeout(0); eventHandler.channelOpen(contractHash); }
/** * Creates a new protobuf handler. * * @param handler The callback listener * @param prototype The default instance of the message type used in both directions of this channel. * This should be the return value from {@link MessageType#getDefaultInstanceForType()} * @param maxMessageSize The maximum message size (not including the 4-byte length prefix). * Note that this has an upper bound of {@link Integer#MAX_VALUE} - 4 * @param timeoutMillis The timeout between messages before the connection is automatically closed. Only enabled * after the connection is established. */ public ProtobufConnection(Listener<MessageType> handler, MessageType prototype, int maxMessageSize, int timeoutMillis) { this.handler = handler; this.prototype = prototype; this.maxMessageSize = Math.min(maxMessageSize, Integer.MAX_VALUE - 4); setTimeoutEnabled(false); setSocketTimeout(timeoutMillis); }
/** * Creates a new protobuf handler. * * @param handler The callback listener * @param prototype The default instance of the message type used in both directions of this channel. * This should be the return value from {@link MessageLite#getDefaultInstanceForType()} * @param maxMessageSize The maximum message size (not including the 4-byte length prefix). * Note that this has an upper bound of {@link Integer#MAX_VALUE} - 4 * @param timeoutMillis The timeout between messages before the connection is automatically closed. Only enabled * after the connection is established. */ public ProtobufConnection(Listener<MessageType> handler, MessageType prototype, int maxMessageSize, int timeoutMillis) { this.handler = handler; this.prototype = prototype; this.maxMessageSize = Math.min(maxMessageSize, Integer.MAX_VALUE - 4); setTimeoutEnabled(false); setSocketTimeout(timeoutMillis); }
/** * Creates a new protobuf handler. * * @param handler The callback listener * @param prototype The default instance of the message type used in both directions of this channel. * This should be the return value from {@link MessageType#getDefaultInstanceForType()} * @param maxMessageSize The maximum message size (not including the 4-byte length prefix). * Note that this has an upper bound of {@link Integer#MAX_VALUE} - 4 * @param timeoutMillis The timeout between messages before the connection is automatically closed. Only enabled * after the connection is established. */ public ProtobufConnection(Listener<MessageType> handler, MessageType prototype, int maxMessageSize, int timeoutMillis) { this.handler = handler; this.prototype = prototype; this.maxMessageSize = Math.min(maxMessageSize, Integer.MAX_VALUE - 4); setTimeoutEnabled(false); setSocketTimeout(timeoutMillis); }
/** * Creates a new protobuf handler. * * @param handler The callback listener * @param prototype The default instance of the message type used in both directions of this channel. * This should be the return value from {@link MessageType#getDefaultInstanceForType()} * @param maxMessageSize The maximum message size (not including the 4-byte length prefix). * Note that this has an upper bound of {@link Integer#MAX_VALUE} - 4 * @param timeoutMillis The timeout between messages before the connection is automatically closed. Only enabled * after the connection is established. */ public ProtobufConnection(Listener<MessageType> handler, MessageType prototype, int maxMessageSize, int timeoutMillis) { this.handler = handler; this.prototype = prototype; this.maxMessageSize = Math.min(maxMessageSize, Integer.MAX_VALUE - 4); setTimeoutEnabled(false); setSocketTimeout(timeoutMillis); }
assertFalse(clientConnection2Closed.isDone() || serverConnection2Closed.isDone()); client2Handler.setSocketTimeout(10); clientConnection2Closed.get(); serverConnection2Closed.get();