1. 网络接收事件增加taskId参数
This commit is contained in:
parent
b3e9b79d98
commit
28c904076a
|
@ -53,6 +53,7 @@ public class MessageHandler<T> extends SimpleChannelInboundHandler<BaseBinaryPro
|
|||
public void channelRead0(ChannelHandlerContext ctx, BaseBinaryProtocol<T> message) throws Exception {
|
||||
SocketNotifyEvent notify = new SocketNotifyEvent(this,
|
||||
ctx.channel(),
|
||||
message.getCommandId(),
|
||||
SocketEventName.SOCKET_EVT_RECV,
|
||||
message.getMsgContent().getMsgBody());
|
||||
applicationEventPublisher.publishEvent(notify);
|
||||
|
|
|
@ -12,6 +12,7 @@ import org.springframework.context.ApplicationEvent;
|
|||
@Setter
|
||||
@Getter
|
||||
public class SocketNotifyEvent extends ApplicationEvent {
|
||||
private int taskId;
|
||||
/**
|
||||
* The Evt message.
|
||||
*/
|
||||
|
@ -33,10 +34,19 @@ public class SocketNotifyEvent extends ApplicationEvent {
|
|||
* @param evtType the evt type
|
||||
* @param evtMessage the evt message
|
||||
*/
|
||||
public SocketNotifyEvent(Object source, Channel ctx, int taskId, SocketEventName evtType, Object evtMessage) {
|
||||
super(source);
|
||||
this.socketEvent = evtType;
|
||||
this.evtMessage = evtMessage;
|
||||
this.ctxChannel = ctx;
|
||||
this.taskId = taskId;
|
||||
}
|
||||
|
||||
public SocketNotifyEvent(Object source, Channel ctx, SocketEventName evtType, Object evtMessage) {
|
||||
super(source);
|
||||
this.socketEvent = evtType;
|
||||
this.evtMessage = evtMessage;
|
||||
this.ctxChannel = ctx;
|
||||
this.taskId = 0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue