C# Class DotNettyServer.DotNetty.NettyServerChannelHandler

因为服务器只需要响应传入的消息,所以只需要实现ChannelHandlerAdapter就可以了
Inheritance: SimpleChannelInboundHandler Afficher le fichier Open project: dotnet9/DotNettyDemo

Méthodes publiques

Méthode Description
ChannelActive ( IChannelHandlerContext context ) : void

通道激活

ChannelInactive ( IChannelHandlerContext context ) : void

断开连接

ChannelReadComplete ( IChannelHandlerContext context ) : void

消息读取完成

ChannelRegistered ( IChannelHandlerContext context ) : void

注册通道

ChannelUnregistered ( IChannelHandlerContext context ) : void

注销通道

ExceptionCaught ( IChannelHandlerContext context, Exception exception ) : void
SendData ( testEvent ) : void

发送数据到客户端

Méthodes protégées

Méthode Description
ChannelRead0 ( IChannelHandlerContext ctx, msg ) : void

收到客户端回应

Method Details

ChannelActive() public méthode

通道激活
public ChannelActive ( IChannelHandlerContext context ) : void
context IChannelHandlerContext
Résultat void

ChannelInactive() public méthode

断开连接
public ChannelInactive ( IChannelHandlerContext context ) : void
context IChannelHandlerContext
Résultat void

ChannelRead0() protected méthode

收到客户端回应
protected ChannelRead0 ( IChannelHandlerContext ctx, msg ) : void
ctx IChannelHandlerContext
Résultat void

ChannelReadComplete() public méthode

消息读取完成
public ChannelReadComplete ( IChannelHandlerContext context ) : void
context IChannelHandlerContext
Résultat void

ChannelRegistered() public méthode

注册通道
public ChannelRegistered ( IChannelHandlerContext context ) : void
context IChannelHandlerContext
Résultat void

ChannelUnregistered() public méthode

注销通道
public ChannelUnregistered ( IChannelHandlerContext context ) : void
context IChannelHandlerContext
Résultat void

ExceptionCaught() public méthode

public ExceptionCaught ( IChannelHandlerContext context, Exception exception ) : void
context IChannelHandlerContext
exception Exception
Résultat void

SendData() public méthode

发送数据到客户端
public SendData ( testEvent ) : void
Résultat void