@Override protected boolean doWriteMessage(Object msg, ChannelOutboundBuffer in) throws Exception { // expects a message final UdtMessage message = (UdtMessage) msg; final ByteBuf byteBuf = message.content(); final int messageSize = byteBuf.readableBytes(); if (messageSize == 0) { return true; } final long writtenBytes; if (byteBuf.nioBufferCount() == 1) { writtenBytes = javaChannel().write(byteBuf.nioBuffer()); } else { writtenBytes = javaChannel().write(byteBuf.nioBuffers()); } // wrote message completely if (writtenBytes > 0 && writtenBytes != messageSize) { throw new Error( "Provider error: failed to write message. Provider library should be upgraded."); } return writtenBytes > 0; }
@Override protected boolean doWriteMessage(Object msg, ChannelOutboundBuffer in) throws Exception { // expects a message final UdtMessage message = (UdtMessage) msg; final ByteBuf byteBuf = message.content(); final int messageSize = byteBuf.readableBytes(); if (messageSize == 0) { return true; } final long writtenBytes; if (byteBuf.nioBufferCount() == 1) { writtenBytes = javaChannel().write(byteBuf.nioBuffer()); } else { writtenBytes = javaChannel().write(byteBuf.nioBuffers()); } // wrote message completely if (writtenBytes > 0 && writtenBytes != messageSize) { throw new Error( "Provider error: failed to write message. Provider library should be upgraded."); } return writtenBytes > 0; }
@Override protected boolean doWriteMessage(Object msg, ChannelOutboundBuffer in) throws Exception { // expects a message final UdtMessage message = (UdtMessage) msg; final ByteBuf byteBuf = message.content(); final int messageSize = byteBuf.readableBytes(); if (messageSize == 0) { return true; } final long writtenBytes; if (byteBuf.nioBufferCount() == 1) { writtenBytes = javaChannel().write(byteBuf.nioBuffer()); } else { writtenBytes = javaChannel().write(byteBuf.nioBuffers()); } // wrote message completely if (writtenBytes > 0 && writtenBytes != messageSize) { throw new Error( "Provider error: failed to write message. Provider library should be upgraded."); } return writtenBytes > 0; }
@Override protected boolean doWriteMessage(Object msg, ChannelOutboundBuffer in) throws Exception { // expects a message final UdtMessage message = (UdtMessage) msg; final ByteBuf byteBuf = message.content(); final int messageSize = byteBuf.readableBytes(); if (messageSize == 0) { return true; } final long writtenBytes; if (byteBuf.nioBufferCount() == 1) { writtenBytes = javaChannel().write(byteBuf.nioBuffer()); } else { writtenBytes = javaChannel().write(byteBuf.nioBuffers()); } // wrote message completely if (writtenBytes > 0 && writtenBytes != messageSize) { throw new Error( "Provider error: failed to write message. Provider library should be upgraded."); } return writtenBytes > 0; }
@Override protected boolean doWriteMessage(Object msg, ChannelOutboundBuffer in) throws Exception { // expects a message final UdtMessage message = (UdtMessage) msg; final ByteBuf byteBuf = message.content(); final int messageSize = byteBuf.readableBytes(); final long writtenBytes; if (byteBuf.nioBufferCount() == 1) { writtenBytes = javaChannel().write(byteBuf.nioBuffer()); } else { writtenBytes = javaChannel().write(byteBuf.nioBuffers()); } // did not write the message if (writtenBytes <= 0 && messageSize > 0) { return false; } // wrote message completely if (writtenBytes != messageSize) { throw new Error( "Provider error: failed to write message. Provider library should be upgraded."); } return true; }
@Override protected boolean doWriteMessage(Object msg, ChannelOutboundBuffer in) throws Exception { // expects a message final UdtMessage message = (UdtMessage) msg; final ByteBuf byteBuf = message.content(); final int messageSize = byteBuf.readableBytes(); if (messageSize == 0) { return true; } final long writtenBytes; if (byteBuf.nioBufferCount() == 1) { writtenBytes = javaChannel().write(byteBuf.nioBuffer()); } else { writtenBytes = javaChannel().write(byteBuf.nioBuffers()); } // wrote message completely if (writtenBytes > 0 && writtenBytes != messageSize) { throw new Error( "Provider error: failed to write message. Provider library should be upgraded."); } return writtenBytes > 0; }
@Override protected boolean doWriteMessage(Object msg, ChannelOutboundBuffer in) throws Exception { // expects a message final UdtMessage message = (UdtMessage) msg; final ByteBuf byteBuf = message.content(); final int messageSize = byteBuf.readableBytes(); final long writtenBytes; if (byteBuf.nioBufferCount() == 1) { writtenBytes = javaChannel().write(byteBuf.nioBuffer()); } else { writtenBytes = javaChannel().write(byteBuf.nioBuffers()); } // did not write the message if (writtenBytes <= 0 && messageSize > 0) { return false; } // wrote message completely if (writtenBytes != messageSize) { throw new Error( "Provider error: failed to write message. Provider library should be upgraded."); } return true; }
@Override protected boolean doWriteMessage(Object msg, ChannelOutboundBuffer in) throws Exception { // expects a message final UdtMessage message = (UdtMessage) msg; final ByteBuf byteBuf = message.content(); final int messageSize = byteBuf.readableBytes(); if (messageSize == 0) { return true; } final long writtenBytes; if (byteBuf.nioBufferCount() == 1) { writtenBytes = javaChannel().write(byteBuf.nioBuffer()); } else { writtenBytes = javaChannel().write(byteBuf.nioBuffers()); } // wrote message completely if (writtenBytes > 0 && writtenBytes != messageSize) { throw new Error( "Provider error: failed to write message. Provider library should be upgraded."); } return writtenBytes > 0; }
@Override protected boolean doWriteMessage(Object msg, ChannelOutboundBuffer in) throws Exception { // expects a message final UdtMessage message = (UdtMessage) msg; final ByteBuf byteBuf = message.content(); final int messageSize = byteBuf.readableBytes(); if (messageSize == 0) { return true; } final long writtenBytes; if (byteBuf.nioBufferCount() == 1) { writtenBytes = javaChannel().write(byteBuf.nioBuffer()); } else { writtenBytes = javaChannel().write(byteBuf.nioBuffers()); } // wrote message completely if (writtenBytes > 0 && writtenBytes != messageSize) { throw new Error( "Provider error: failed to write message. Provider library should be upgraded."); } return writtenBytes > 0; }
@Override protected boolean doWriteMessage(Object msg, ChannelOutboundBuffer in) throws Exception { // expects a message final UdtMessage message = (UdtMessage) msg; final ByteBuf byteBuf = message.content(); final int messageSize = byteBuf.readableBytes(); if (messageSize == 0) { return true; } final long writtenBytes; if (byteBuf.nioBufferCount() == 1) { writtenBytes = javaChannel().write(byteBuf.nioBuffer()); } else { writtenBytes = javaChannel().write(byteBuf.nioBuffers()); } // wrote message completely if (writtenBytes > 0 && writtenBytes != messageSize) { throw new Error( "Provider error: failed to write message. Provider library should be upgraded."); } return writtenBytes > 0; }
@Override protected boolean doWriteMessage(Object msg, ChannelOutboundBuffer in) throws Exception { // expects a message final UdtMessage message = (UdtMessage) msg; final ByteBuf byteBuf = message.content(); final int messageSize = byteBuf.readableBytes(); if (messageSize == 0) { return true; } final long writtenBytes; if (byteBuf.nioBufferCount() == 1) { writtenBytes = javaChannel().write(byteBuf.nioBuffer()); } else { writtenBytes = javaChannel().write(byteBuf.nioBuffers()); } // wrote message completely if (writtenBytes > 0 && writtenBytes != messageSize) { throw new Error( "Provider error: failed to write message. Provider library should be upgraded."); } return writtenBytes > 0; }