public interface Business<T,U>
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close(io.netty.channel.Channel channel)
链接关闭
|
boolean |
connectController(io.netty.channel.ChannelHandlerContext ctx,
boolean connectResult,
int connectNum,
Throwable error)
失败是否重连,同时告知连接结果
返回真标识重新重连
|
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause)
全局异常
|
SocketAddress |
getProxyHost(io.netty.channel.ChannelHandlerContext ctx,
T t,
SocketAddress sourceSocketAddress)
代理host
业务代码只处理选择什么样的服务,比如常见随机模式 hash模式 循环模式等
|
Object |
in(io.netty.channel.ChannelHandlerContext ctx,
T t)
数据入场
业务处理模式,拦截器 限流等
|
Object |
out(io.netty.channel.Channel channel,
U u)
数据出场
数据加密等操作
|
SocketAddress getProxyHost(io.netty.channel.ChannelHandlerContext ctx, T t, SocketAddress sourceSocketAddress)
t - sourceSocketAddress - void close(io.netty.channel.Channel channel)
channel - boolean connectController(io.netty.channel.ChannelHandlerContext ctx,
boolean connectResult,
int connectNum,
Throwable error)
ctx - connectResult - 连接结果connectNum - 连接次数error - 连接错误void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause)
ctx - cause - Copyright © 2023. All rights reserved.