mirror of
https://gitee.com/xchao/j-im.git
synced 2024-12-02 11:57:43 +08:00
更改serverHandlerManager构造方法
This commit is contained in:
parent
ac0ee316ed
commit
7477e5f530
@ -56,7 +56,7 @@ public class ImServerAioHandler implements ServerAioHandler {
|
||||
*/
|
||||
@Override
|
||||
public void handler(Packet packet, ChannelContext channelContext) throws Exception {
|
||||
AbServerHandler handler = serverHandlerManager.getServerHandler(null,packet,channelContext);
|
||||
AbServerHandler handler = serverHandlerManager.getServerHandler(null,channelContext);
|
||||
if(handler != null){
|
||||
handler.handler(packet, channelContext);
|
||||
}
|
||||
@ -73,7 +73,7 @@ public class ImServerAioHandler implements ServerAioHandler {
|
||||
*/
|
||||
@Override
|
||||
public ByteBuffer encode(Packet packet, GroupContext groupContext, ChannelContext channelContext) {
|
||||
AbServerHandler handler = serverHandlerManager.getServerHandler(null,packet,channelContext);
|
||||
AbServerHandler handler = serverHandlerManager.getServerHandler(null,channelContext);
|
||||
if(handler != null){
|
||||
return handler.encode(packet, groupContext, channelContext);
|
||||
}
|
||||
@ -92,7 +92,7 @@ public class ImServerAioHandler implements ServerAioHandler {
|
||||
*/
|
||||
@Override
|
||||
public Packet decode(ByteBuffer buffer, ChannelContext channelContext) throws AioDecodeException {
|
||||
AbServerHandler handler = serverHandlerManager.getServerHandler(buffer,null,channelContext);
|
||||
AbServerHandler handler = serverHandlerManager.getServerHandler(buffer,channelContext);
|
||||
if(handler != null){
|
||||
return handler.decode(buffer, channelContext);
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ import java.util.Map.Entry;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.tio.core.ChannelContext;
|
||||
import org.tio.core.intf.Packet;
|
||||
import org.tio.server.ServerGroupContext;
|
||||
/**
|
||||
* 版本: [1.0]
|
||||
@ -42,7 +41,7 @@ public class ServerHandlerManager{
|
||||
return this;
|
||||
}
|
||||
|
||||
public AbServerHandler getServerHandler(ByteBuffer buffer,Packet packet,ChannelContext channelContext){
|
||||
public AbServerHandler getServerHandler(ByteBuffer buffer,ChannelContext channelContext){
|
||||
for(Entry<String,AbServerHandler> entry : serverHandlers.entrySet()){
|
||||
ByteBuffer copyByteBuffer = null;
|
||||
if(buffer != null){
|
||||
|
Loading…
Reference in New Issue
Block a user