@Override protected void doClose() throws Exception { javaChannel().close(); }
@Override protected void doClose() throws Exception { javaChannel().close(); }
@Override protected void doClose() throws Exception { javaChannel().close(); }
@Override protected void doClose() throws Exception { javaChannel().close(); }
@Override protected int doReadMessages(List<Object> buf) throws Exception { final int maximumMessageSize = config.getReceiveBufferSize(); final ByteBuf byteBuf = config.getAllocator().directBuffer( maximumMessageSize); final int receivedMessageSize = byteBuf.writeBytes(javaChannel(), maximumMessageSize); if (receivedMessageSize <= 0) { byteBuf.release(); return 0; } if (receivedMessageSize >= maximumMessageSize) { javaChannel().close(); throw new ChannelException( "Invalid config : increase receive buffer size to avoid message truncation"); } // delivers a message buf.add(new UdtMessage(byteBuf)); return 1; }
@Override protected int doReadMessages(List<Object> buf) throws Exception { final int maximumMessageSize = config.getReceiveBufferSize(); final ByteBuf byteBuf = config.getAllocator().directBuffer( maximumMessageSize); final int receivedMessageSize = byteBuf.writeBytes(javaChannel(), maximumMessageSize); if (receivedMessageSize <= 0) { byteBuf.release(); return 0; } if (receivedMessageSize >= maximumMessageSize) { javaChannel().close(); throw new ChannelException( "Invalid config : increase receive buffer size to avoid message truncation"); } // delivers a message buf.add(new UdtMessage(byteBuf)); return 1; }
public NioUdtMessageConnectorChannel(final Channel parent, final SocketChannelUDT channelUDT) { super(parent, channelUDT, OP_READ); try { channelUDT.configureBlocking(false); switch (channelUDT.socketUDT().status()) { case INIT: case OPENED: config = new DefaultUdtChannelConfig(this, channelUDT, true); break; default: config = new DefaultUdtChannelConfig(this, channelUDT, false); break; } } catch (final Exception e) { try { channelUDT.close(); } catch (final Exception e2) { if (logger.isWarnEnabled()) { logger.warn("Failed to close channel.", e2); } } throw new ChannelException("Failed to configure channel.", e); } }
public NioUdtByteConnectorChannel(final Channel parent, final SocketChannelUDT channelUDT) { super(parent, channelUDT); try { channelUDT.configureBlocking(false); switch (channelUDT.socketUDT().status()) { case INIT: case OPENED: config = new DefaultUdtChannelConfig(this, channelUDT, true); break; default: config = new DefaultUdtChannelConfig(this, channelUDT, false); break; } } catch (final Exception e) { try { channelUDT.close(); } catch (final Exception e2) { if (logger.isWarnEnabled()) { logger.warn("Failed to close channel.", e2); } } throw new ChannelException("Failed to configure channel.", e); } }
public NioUdtMessageConnectorChannel(final Channel parent, final SocketChannelUDT channelUDT) { super(parent, channelUDT, OP_READ); try { channelUDT.configureBlocking(false); switch (channelUDT.socketUDT().status()) { case INIT: case OPENED: config = new DefaultUdtChannelConfig(this, channelUDT, true); break; default: config = new DefaultUdtChannelConfig(this, channelUDT, false); break; } } catch (final Exception e) { try { channelUDT.close(); } catch (final Exception e2) { if (logger.isWarnEnabled()) { logger.warn("Failed to close channel.", e2); } } throw new ChannelException("Failed to configure channel.", e); } }
public NioUdtByteConnectorChannel(final Channel parent, final SocketChannelUDT channelUDT) { super(parent, channelUDT); try { channelUDT.configureBlocking(false); switch (channelUDT.socketUDT().status()) { case INIT: case OPENED: config = new DefaultUdtChannelConfig(this, channelUDT, true); break; default: config = new DefaultUdtChannelConfig(this, channelUDT, false); break; } } catch (final Exception e) { try { channelUDT.close(); } catch (final Exception e2) { if (logger.isWarnEnabled()) { logger.warn("Failed to close channel.", e2); } } throw new ChannelException("Failed to configure channel.", e); } }
@Override protected void doClose() throws Exception { javaChannel().close(); }
@Override protected void doClose() throws Exception { javaChannel().close(); }
@Override protected void doClose() throws Exception { javaChannel().close(); }
@Override protected void doClose() throws Exception { javaChannel().close(); }
@Override protected void doClose() throws Exception { javaChannel().close(); }
@Override protected void doClose() throws Exception { javaChannel().close(); }
@Override protected void doClose() throws Exception { javaChannel().close(); }
@Override protected void doClose() throws Exception { javaChannel().close(); }
@Override protected void doClose() throws Exception { javaChannel().close(); }
@Override protected void doClose() throws Exception { javaChannel().close(); }