Class ChannelCloseUtils
java.lang.Object
io.servicetalk.transport.netty.internal.ChannelCloseUtils
Utilities to handle
Channel
closure and its reason.-
Method Summary
Modifier and TypeMethodDescriptionstatic void
assignConnectionError
(io.netty.channel.Channel channel, Throwable error) Assigns aThrowable
to the passedChannel
to report it as a closure reason.static Throwable
channelError
(io.netty.channel.Channel channel) Returns anerror
associated with the passedChannel
.static io.netty.channel.ChannelFuture
Close the passedChannelHandlerContext
due to the observederror
.static io.netty.channel.ChannelFuture
Close the passedChannel
due to the observederror
.
-
Method Details
-
assignConnectionError
Assigns aThrowable
to the passedChannel
to report it as a closure reason. -
close
public static io.netty.channel.ChannelFuture close(io.netty.channel.Channel channel, Throwable error) Close the passedChannel
due to the observederror
.- Parameters:
channel
- aChannel
to closeerror
- aerror
that leads to theChannel
closure- Returns:
ChannelFuture
that will be notified once the operation completes
-
close
public static io.netty.channel.ChannelFuture close(io.netty.channel.ChannelHandlerContext ctx, Throwable error) Close the passedChannelHandlerContext
due to the observederror
.- Parameters:
ctx
- aChannelHandlerContext
to closeerror
- aerror
that leads to theChannelHandlerContext
closure- Returns:
ChannelFuture
that will be notified once the operation completes
-
channelError
Returns anerror
associated with the passedChannel
.
-