First clean of Moquette's channel abstraction to user Netty's one
This commit is contained in:
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package io.moquette.server;
|
||||
|
||||
import io.netty.channel.Channel;
|
||||
|
||||
/**
|
||||
* Value object to maintain the information of single connection, like ClientID, IoSession,
|
||||
* and other clean session fla.
|
||||
@@ -25,10 +27,10 @@ package io.moquette.server;
|
||||
public class ConnectionDescriptor {
|
||||
|
||||
public final String clientID;
|
||||
public final ServerChannel session;
|
||||
public final Channel session;
|
||||
public final boolean cleanSession;
|
||||
|
||||
public ConnectionDescriptor(String clientID, ServerChannel session, boolean cleanSession) {
|
||||
public ConnectionDescriptor(String clientID, Channel session, boolean cleanSession) {
|
||||
this.clientID = clientID;
|
||||
this.session = session;
|
||||
this.cleanSession = cleanSession;
|
||||
|
||||
@@ -49,7 +49,7 @@ public class NettyMQTTHandler extends ChannelInboundHandlerAdapter {
|
||||
try {
|
||||
switch (msg.getMessageType()) {
|
||||
case CONNECT:
|
||||
m_processor.processConnect(new NettyChannel(ctx), (ConnectMessage) msg);
|
||||
m_processor.processConnect(ctx.channel(), (ConnectMessage) msg);
|
||||
break;
|
||||
case SUBSCRIBE:
|
||||
m_processor.processSubscribe(new NettyChannel(ctx), (SubscribeMessage) msg);
|
||||
@@ -96,7 +96,7 @@ public class NettyMQTTHandler extends ChannelInboundHandlerAdapter {
|
||||
if (stolenAttr != null && stolenAttr == Boolean.TRUE) {
|
||||
stolen = stolenAttr;
|
||||
}
|
||||
m_processor.processConnectionLost(clientID, stolen, new NettyChannel(ctx));
|
||||
m_processor.processConnectionLost(clientID, stolen, ctx.channel());
|
||||
}
|
||||
ctx.close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user