public class NettyConnector extends Connector
LinkPool进行处理,NettyConnector本身不维护任何连接。| 限定符和类型 | 字段和说明 |
|---|---|
protected org.slf4j.Logger |
logger |
| 构造器和说明 |
|---|
NettyConnector(String protocol,
AppContext appContext,
ReceivedListener receivedListener,
ConnectionAccepter accepter) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected boolean |
acceptIn(io.netty.channel.ChannelHandlerContext ctx)
IP黑名单实现(包内可见)
|
void |
connectionTo(InterAddress hostAddress,
net.hasor.utils.future.BasicFuture<RsfChannel> result)
连接到远程机器
|
protected ProtocolHandlerFactory |
createHandler(String protocol,
AppContext appContext)
创建 ProtocolHandlerFactory 对象。
|
io.netty.channel.EventLoopGroup |
getWorkerGroup()
获取work线程组
|
void |
receivedData(RsfChannel target,
OptionInfo object)
接收到数据(方法public化)
|
void |
shutdownListener()
停止监听器
|
void |
startListener(AppContext appContext)
启动本地监听器
|
acceptChannel, configListener, findRsfChannelByHostPort, getBindAddress, getOrConnectionTo, getProtocol, getRsfEnvironment, getSechma, shutdown, toStringpublic NettyConnector(String protocol, AppContext appContext, ReceivedListener receivedListener, ConnectionAccepter accepter) throws ClassNotFoundException
public io.netty.channel.EventLoopGroup getWorkerGroup()
protected ProtocolHandlerFactory createHandler(String protocol, AppContext appContext) throws ClassNotFoundException
public void startListener(AppContext appContext) throws Throwable
startListener 在类中 ConnectorThrowablepublic void shutdownListener()
shutdownListener 在类中 Connectorpublic void receivedData(RsfChannel target, OptionInfo object)
receivedData 在类中 Connectorpublic void connectionTo(InterAddress hostAddress, net.hasor.utils.future.BasicFuture<RsfChannel> result)
connectionTo 在类中 ConnectorCopyright © 2020–2021. All rights reserved.