@Override public void connectionOpened() { setTimeoutEnabled(true); handler.connectionOpen(this); }
@Override public void connectionOpened() { setTimeoutEnabled(true); handler.connectionOpen(this); }
@Override public void connectionOpened() { setTimeoutEnabled(true); handler.connectionOpen(this); }
@Override public void connectionOpened() { setTimeoutEnabled(true); handler.connectionOpen(this); }
/** * 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); }
/** * 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); }