v4.6.9版本BUG
This commit is contained in:
parent
70626f9b6f
commit
23885ea2b7
|
|
@ -11,6 +11,7 @@ import com.ifish.entity.*;
|
|||
import com.ifish.entity.event.QueueEventBody;
|
||||
import com.ifish.entity.event.QueueEventEntity;
|
||||
import com.ifish.socketNew.model.receive.*;
|
||||
import org.apache.mina.core.buffer.IoBuffer;
|
||||
import org.apache.mina.core.session.IoSession;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
|
@ -76,18 +77,21 @@ public class SomeServer {
|
|||
public void doSome(IoSession session, Object message) {
|
||||
//通配字符串
|
||||
if(message instanceof byte[]){
|
||||
|
||||
byte[] bytes = (byte[]) message;
|
||||
//长度
|
||||
int length = bytes[14] & 0xff;
|
||||
//mac地址
|
||||
IoBuffer ioBuffer = ByteUtil.byteToIoBuffer(bytes, length);
|
||||
//类型
|
||||
byte type = ioBuffer.get();
|
||||
|
||||
byte[] srcByte = new byte[6];
|
||||
for (int i = 2; i < 8; i++) {
|
||||
srcByte[i-2] = bytes[i];
|
||||
}
|
||||
String strSrc = ByteUtil.bytesToHexString(srcByte);
|
||||
//心跳
|
||||
if(length>=28){
|
||||
if(type == 1){
|
||||
sendToApp(session,strSrc, message);
|
||||
}
|
||||
else{
|
||||
|
|
|
|||
|
|
@ -128,6 +128,8 @@ public class ServerDecode implements ProtocolDecoder {
|
|||
case 24:{
|
||||
if(check_code==1){
|
||||
functionCode1(buf, out);
|
||||
}else{
|
||||
out.write(bytes);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -135,6 +137,8 @@ public class ServerDecode implements ProtocolDecoder {
|
|||
case 25:{
|
||||
if(check_code==0){
|
||||
functionCode0(buf, out);
|
||||
}else{
|
||||
out.write(bytes);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -142,6 +146,8 @@ public class ServerDecode implements ProtocolDecoder {
|
|||
case 42:{
|
||||
if(check_code==17){
|
||||
functionCode17(buf, out);
|
||||
}else{
|
||||
out.write(bytes);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue