use of org.apache.flink.shaded.netty4.io.netty.channel.ChannelException in project netty by netty.
the class KQueueSocketChannelConfig method setSendBufferSize.
@Override
public KQueueSocketChannelConfig setSendBufferSize(int sendBufferSize) {
try {
((KQueueSocketChannel) channel).socket.setSendBufferSize(sendBufferSize);
calculateMaxBytesPerGatheringWrite();
return this;
} catch (IOException e) {
throw new ChannelException(e);
}
}
use of org.apache.flink.shaded.netty4.io.netty.channel.ChannelException in project JaPS by JackWhite20.
the class ServerChannelInitializer method initChannel.
@Override
protected void initChannel(Channel channel) throws Exception {
try {
channel.config().setOption(ChannelOption.IP_TOS, 0x18);
} catch (ChannelException e) {
// Not supported
}
channel.config().setAllocator(PooledByteBufAllocator.DEFAULT);
channel.pipeline().addLast(new LengthFieldBasedFrameDecoder(Integer.MAX_VALUE, 0, 4));
channel.pipeline().addLast(new JSONObjectDecoder());
channel.pipeline().addLast(new LengthFieldPrepender(4));
channel.pipeline().addLast(new JSONObjectEncoder());
channel.pipeline().addLast(new Connection(jaPSServer, channel));
}
use of org.apache.flink.shaded.netty4.io.netty.channel.ChannelException in project JaPS by JackWhite20.
the class ClientChannelInitializer method initChannel.
@Override
protected void initChannel(Channel channel) throws Exception {
try {
channel.config().setOption(ChannelOption.IP_TOS, 0x18);
} catch (ChannelException e) {
// Not supported
}
channel.config().setAllocator(PooledByteBufAllocator.DEFAULT);
channel.pipeline().addLast(new LengthFieldBasedFrameDecoder(Integer.MAX_VALUE, 0, 4));
channel.pipeline().addLast(new JSONObjectDecoder());
channel.pipeline().addLast(new LengthFieldPrepender(4));
channel.pipeline().addLast(new JSONObjectEncoder());
channel.pipeline().addLast(nioSocketClient);
}
use of org.apache.flink.shaded.netty4.io.netty.channel.ChannelException in project rest.li by linkedin.
the class Http2AlpnHandler method handlerAdded.
@Override
public void handlerAdded(ChannelHandlerContext ctx) {
_alpnPromise = ctx.channel().newPromise();
// the class will take care of establishing the SSL connection
ctx.pipeline().addFirst(SessionResumptionSslHandler.PIPELINE_SESSION_RESUMPTION_HANDLER, new SessionResumptionSslHandler(_sslContext, _enableSSLSessionResumption, _sslHandShakeTimeout));
// Fail the ALPN promise when channel is closed
ctx.channel().closeFuture().addListener(future -> {
if (!_alpnPromise.isDone()) {
_alpnPromise.setFailure(new ChannelException("HTTP/2 ALPN did not complete before channel closed"));
}
});
}
use of org.apache.flink.shaded.netty4.io.netty.channel.ChannelException in project rest.li by linkedin.
the class ErrorChannelFutureListener method operationComplete.
@Override
public void operationComplete(ChannelFuture future) throws Exception {
if (!future.isSuccess()) {
Channel channel = future.channel();
Long createTime = channel.attr(ChannelPoolLifecycle.CHANNEL_CREATION_TIME_KEY).get();
String message = String.format("Channel %s encountered exception on write and flush, remote=%s, createTime=%s", channel.id(), channel.remoteAddress(), createTime);
channel.pipeline().fireExceptionCaught(new ChannelException(message, future.cause()));
}
}
Aggregations