/** * Configures <tt>NIOTransport</tt> to be optimized for specific for the * connection multiplexing usecase, when different threads will try to * write data simultaneously. */ public void setOptimizedForMultiplexing(final boolean optimizedForMultiplexing) { this.optimizedForMultiplexing = optimizedForMultiplexing; getAsyncQueueIO().getWriter().setAllowDirectWrite(!optimizedForMultiplexing); }
/** * {@inheritDoc} */ @Override public Reader<SocketAddress> getReader(final boolean isBlocking) { if (isBlocking) { return getTemporarySelectorIO().getReader(); } else { return getAsyncQueueIO().getReader(); } }
@Override protected void closeConnection(final Connection connection) throws IOException { final SelectableChannel nioChannel = ((NIOConnection) connection).getChannel(); if (nioChannel != null) { try { nioChannel.close(); } catch (IOException e) { LOGGER.log(Level.FINE, "TCPNIOTransport.closeChannel exception", e); } } if (asyncQueueIO != null) { final AsyncQueueReader reader = asyncQueueIO.getReader(); if (reader != null) { reader.onClose(connection); } final AsyncQueueWriter writer = asyncQueueIO.getWriter(); if (writer != null) { writer.onClose(connection); } } }
/** * The maximum size, in bytes, of all data waiting to be written to the associated {@link Connection}. * If the value is zero or less, then no resource enforcement will take place. * * @param maxPendingBytes the maximum size, in bytes, of all data waiting to be written to the associated {@link * Connection}. */ public void setMaxPendingBytes(int maxPendingBytes) { this.maxPendingBytes = maxPendingBytes; transport.getAsyncQueueIO().getWriter().setMaxPendingBytesPerConnection(maxPendingBytes); }
/** * {@inheritDoc} */ @Override public Reader<SocketAddress> getReader(final boolean isBlocking) { if (isBlocking) { return getTemporarySelectorIO().getReader(); } else { return getAsyncQueueIO().getReader(); } }
/** * The maximum size, in bytes, of all data waiting to be written to the associated {@link Connection}. * If the value is zero or less, then no resource enforcement will take place. * * @param maxPendingBytes the maximum size, in bytes, of all data waiting to be written to the associated {@link * Connection}. */ public void setMaxPendingBytes(int maxPendingBytes) { this.maxPendingBytes = maxPendingBytes; transport.getAsyncQueueIO().getWriter().setMaxPendingBytesPerConnection(maxPendingBytes); }
/** * {@inheritDoc} */ @Override public Reader<SocketAddress> getReader(final boolean isBlocking) { if (isBlocking) { return getTemporarySelectorIO().getReader(); } else { return getAsyncQueueIO().getReader(); } }
/** * Configures <tt>NIOTransport</tt> to be optimized for specific for the * connection multiplexing usecase, when different threads will try to * write data simultaneously. */ public void setOptimizedForMultiplexing(final boolean optimizedForMultiplexing) { this.optimizedForMultiplexing = optimizedForMultiplexing; getAsyncQueueIO().getWriter().setAllowDirectWrite(!optimizedForMultiplexing); }
/** * {@inheritDoc} */ @Override public Reader getReader(final boolean isBlocking) { if (isBlocking) { return getTemporarySelectorIO().getReader(); } else { return getAsyncQueueIO().getReader(); } }
/** * Configures <tt>NIOTransport</tt> to be optimized for specific for the * connection multiplexing usecase, when different threads will try to * write data simultaneously. */ public void setOptimizedForMultiplexing(final boolean optimizedForMultiplexing) { this.optimizedForMultiplexing = optimizedForMultiplexing; getAsyncQueueIO().getWriter().setAllowDirectWrite(!optimizedForMultiplexing); }
/** * {@inheritDoc} */ @Override public Reader getReader(final boolean isBlocking) { if (isBlocking) { return getTemporarySelectorIO().getReader(); } else { return getAsyncQueueIO().getReader(); } }
/** * Configures <tt>NIOTransport</tt> to be optimized for specific for the * connection multiplexing usecase, when different threads will try to * write data simultaneously. */ public void setOptimizedForMultiplexing(final boolean optimizedForMultiplexing) { this.optimizedForMultiplexing = optimizedForMultiplexing; getAsyncQueueIO().getWriter().setAllowDirectWrite(!optimizedForMultiplexing); }
/** * {@inheritDoc} */ @Override public Reader<SocketAddress> getReader(final boolean isBlocking) { if (isBlocking) { return getTemporarySelectorIO().getReader(); } else { return getAsyncQueueIO().getReader(); } }
/** * The maximum size, in bytes, of all data waiting to be written to the associated {@link Connection}. * If the value is zero or less, then no resource enforcement will take place. * * @param maxPendingBytes the maximum size, in bytes, of all data waiting to be written to the associated {@link * Connection}. */ public void setMaxPendingBytes(int maxPendingBytes) { this.maxPendingBytes = maxPendingBytes; transport.getAsyncQueueIO().getWriter().setMaxPendingBytesPerConnection(maxPendingBytes); }
/** * {@inheritDoc} */ @Override public Reader<SocketAddress> getReader(final boolean isBlocking) { if (isBlocking) { return getTemporarySelectorIO().getReader(); } else { return getAsyncQueueIO().getReader(); } }
/** * The maximum size, in bytes, of all data waiting to be written to the associated {@link Connection}. * If the value is zero or less, then no resource enforcement will take place. * * @param maxPendingBytes the maximum size, in bytes, of all data waiting to be written to the associated {@link * Connection}. */ public void setMaxPendingBytes(int maxPendingBytes) { this.maxPendingBytes = maxPendingBytes; transport.getAsyncQueueIO().getWriter().setMaxPendingBytesPerConnection(maxPendingBytes); }
/** * {@inheritDoc} */ @Override public Reader<SocketAddress> getReader(final boolean isBlocking) { if (isBlocking) { return getTemporarySelectorIO().getReader(); } else { return getAsyncQueueIO().getReader(); } }
/** * The maximum size, in bytes, of all data waiting to be written to the associated {@link Connection}. * If the value is zero or less, then no resource enforcement will take place. * * @param maxPendingBytes the maximum size, in bytes, of all data waiting to be written to the associated {@link * Connection}. */ public void setMaxPendingBytes(int maxPendingBytes) { this.maxPendingBytes = maxPendingBytes; transport.getAsyncQueueIO().getWriter().setMaxPendingBytesPerConnection(maxPendingBytes); }
/** * {@inheritDoc} */ @Override public Reader<SocketAddress> getReader(final boolean isBlocking) { if (isBlocking) { return getTemporarySelectorIO().getReader(); } else { return getAsyncQueueIO().getReader(); } }
/** * The maximum size, in bytes, of all data waiting to be written to the associated {@link Connection}. * If the value is zero or less, then no resource enforcement will take place. * * @param maxPendingBytes the maximum size, in bytes, of all data waiting to be written to the associated {@link * Connection}. */ public void setMaxPendingBytes(int maxPendingBytes) { this.maxPendingBytes = maxPendingBytes; transport.getAsyncQueueIO().getWriter().setMaxPendingBytesPerConnection(maxPendingBytes); }