private ConnectionHandler(@Nullable StreamConnection connection, SelectionKey key) { this.key = key; this.channel = checkNotNull(((SocketChannel)key.channel())); if (connection == null) { readBuff = null; return; } this.connection = connection; readBuff = ByteBuffer.allocateDirect(Math.min(Math.max(connection.getMaxMessageSize(), BUFFER_SIZE_LOWER_BOUND), BUFFER_SIZE_UPPER_BOUND)); connection.setWriteTarget(this); // May callback into us (eg closeConnection() now) connectedHandlers = null; }
private ConnectionHandler(@Nullable StreamConnection connection, SelectionKey key) { this.key = key; this.channel = checkNotNull(((SocketChannel)key.channel())); if (connection == null) { readBuff = null; return; } this.connection = connection; readBuff = ByteBuffer.allocateDirect(Math.min(Math.max(connection.getMaxMessageSize(), BUFFER_SIZE_LOWER_BOUND), BUFFER_SIZE_UPPER_BOUND)); connection.setWriteTarget(this); // May callback into us (eg closeConnection() now) connectedHandlers = null; }
private ConnectionHandler(@Nullable StreamConnection connection, SelectionKey key) { this.key = key; this.channel = checkNotNull(((SocketChannel)key.channel())); if (connection == null) { readBuff = null; return; } this.connection = connection; readBuff = ByteBuffer.allocateDirect(Math.min(Math.max(connection.getMaxMessageSize(), BUFFER_SIZE_LOWER_BOUND), BUFFER_SIZE_UPPER_BOUND)); connection.setWriteTarget(this); // May callback into us (eg closeConnection() now) connectedHandlers = null; }
private ConnectionHandler(@Nullable StreamConnection connection, SelectionKey key) { this.key = key; this.channel = checkNotNull(((SocketChannel)key.channel())); if (connection == null) { readBuff = null; return; } this.connection = connection; readBuff = ByteBuffer.allocateDirect(Math.min(Math.max(connection.getMaxMessageSize(), BUFFER_SIZE_LOWER_BOUND), BUFFER_SIZE_UPPER_BOUND)); connection.setWriteTarget(this); // May callback into us (eg closeConnection() now) connectedHandlers = null; }
@Override public synchronized void setWriteTarget(MessageWriteTarget writeTarget) { if (closeOnOpen) writeTarget.closeConnection(); else { setTimeoutEnabled(false); this.writeTarget = writeTarget; upstreamConnection.setWriteTarget(writeTarget); } }
@Override public synchronized void setWriteTarget(MessageWriteTarget writeTarget) { if (closeOnOpen) writeTarget.closeConnection(); else { setTimeoutEnabled(false); this.writeTarget = writeTarget; upstreamConnection.setWriteTarget(writeTarget); } }
@Override public synchronized void setWriteTarget(MessageWriteTarget writeTarget) { if (closeOnOpen) writeTarget.closeConnection(); else { setTimeoutEnabled(false); this.writeTarget = writeTarget; upstreamConnection.setWriteTarget(writeTarget); } }
@Override public synchronized void setWriteTarget(MessageWriteTarget writeTarget) { if (closeOnOpen) writeTarget.closeConnection(); else { setTimeoutEnabled(false); this.writeTarget = writeTarget; upstreamConnection.setWriteTarget(writeTarget); } }
connection.setWriteTarget(this); socket = socketFactory.createSocket(); final Context context = Context.get();
connection.setWriteTarget(this); socket = socketFactory.createSocket(); final Context context = Context.get();
connection.setWriteTarget(this); socket = socketFactory.createSocket(); final Context context = Context.get();
connection.setWriteTarget(this); socket = socketFactory.createSocket(); final Context context = Context.get();