public class NettyServer extends AbstractNettyServer
| 限定符和类型 | 字段和说明 |
|---|---|
protected io.netty.bootstrap.ServerBootstrap |
booter |
protected io.netty.channel.group.ChannelGroup |
channelGroup |
protected NettyServerConfig |
config |
protected io.netty.channel.ChannelHandler |
handler |
local, serverCahnel| 构造器和说明 |
|---|
NettyServer(InetSocketAddress local,
io.netty.channel.ChannelHandler handler) |
NettyServer(NettyServerConfig config,
InetSocketAddress local,
io.netty.channel.ChannelHandler handler) |
NettyServer(NettyServerConfig config,
InetSocketAddress local,
WebSocketServerAdapterHandler handler) |
NettyServer(NettyServerConfig config,
String host,
int port,
io.netty.channel.ChannelHandler handler) |
NettyServer(String host,
int port,
io.netty.channel.ChannelHandler handler) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
broadCast(Object message) |
protected io.netty.channel.ChannelFuture |
doBind(InetSocketAddress local)
使用起动器进行端口绑定
|
protected io.netty.channel.ChannelFuture |
doBooterBind(InetSocketAddress local,
io.netty.channel.ChannelHandler fixedHandler) |
protected io.netty.channel.ChannelHandler |
fixHandlerBeforeDoBooterBind(io.netty.channel.ChannelHandler handler)
执行启动绑定之前修正handler,子类可进行二次修改
|
io.netty.bootstrap.ServerBootstrap |
getBooter()
获取服务端使用的起动器
|
io.netty.channel.EventLoopGroup |
getBossWorkers()
获取服务端使用的选择线程池
|
io.netty.channel.group.ChannelGroup |
getChannelGroup() |
JConnection |
getConnection(long id) |
int |
getConnectionCount() |
Set<JConnection> |
getConnections() |
io.netty.channel.EventLoopGroup |
getIoWorkers()
获取服务端使用的IO线程池
|
protected io.netty.channel.ChannelHandler |
initLogHandlerAdapter(io.netty.channel.ChannelHandler init)
初始化handler适配包装
|
protected void |
initServerOptions(ServerOptionConfiger configer) |
protected void |
manageChannel(io.netty.channel.Channel channel) |
ServerOptionConfiger |
optionConfig() |
protected final io.netty.channel.group.ChannelGroup channelGroup
protected final NettyServerConfig config
protected final io.netty.bootstrap.ServerBootstrap booter
protected final io.netty.channel.ChannelHandler handler
public NettyServer(String host, int port, io.netty.channel.ChannelHandler handler)
public NettyServer(InetSocketAddress local, io.netty.channel.ChannelHandler handler)
public NettyServer(NettyServerConfig config, String host, int port, io.netty.channel.ChannelHandler handler)
public NettyServer(NettyServerConfig config, InetSocketAddress local, io.netty.channel.ChannelHandler handler)
public NettyServer(NettyServerConfig config, InetSocketAddress local, WebSocketServerAdapterHandler handler)
protected void initServerOptions(ServerOptionConfiger configer)
public ServerOptionConfiger optionConfig()
protected void manageChannel(io.netty.channel.Channel channel)
protected io.netty.channel.ChannelHandler initLogHandlerAdapter(io.netty.channel.ChannelHandler init)
init - protected io.netty.channel.ChannelHandler fixHandlerBeforeDoBooterBind(io.netty.channel.ChannelHandler handler)
handler - protected final io.netty.channel.ChannelFuture doBind(InetSocketAddress local)
AbstractNettyServerdoBind 在类中 AbstractNettyServerprotected io.netty.channel.ChannelFuture doBooterBind(InetSocketAddress local, io.netty.channel.ChannelHandler fixedHandler)
public io.netty.bootstrap.ServerBootstrap getBooter()
AbstractNettyServergetBooter 在类中 AbstractNettyServerpublic io.netty.channel.EventLoopGroup getIoWorkers()
AbstractNettyServergetIoWorkers 在类中 AbstractNettyServerpublic io.netty.channel.EventLoopGroup getBossWorkers()
AbstractNettyServergetBossWorkers 在类中 AbstractNettyServerpublic io.netty.channel.group.ChannelGroup getChannelGroup()
public JConnection getConnection(long id)
public Set<JConnection> getConnections()
public final void broadCast(Object message)
public int getConnectionCount()
Copyright © 2020. All rights reserved.