updated mgmt

This commit is contained in:
free will
2021-04-29 14:35:19 +08:00
parent e6aa89cc3b
commit b1535aa824
2 changed files with 14 additions and 3 deletions
+1 -1
View File
@@ -80,7 +80,7 @@ public class LogicFace {
channel.connect(new InetSocketAddress(ip, Integer.parseInt(port)));
this.linkService=new LinkService();
UdpTransport udpTransport=new UdpTransport();
udpTransport.init(channel);
udpTransport.init(channel,new InetSocketAddress(ip, Integer.parseInt(port)));
this.linkService.init(9000); // 设置MTU为 9000 字节
this.linkService.logicFace=this;
this.linkService.transport=udpTransport;
+13 -2
View File
@@ -39,8 +39,19 @@ public class BytesBuffer {
len++;
}
public void put(byte[] bytes){
//todo:
/**
* put进一个byte[]
* @param bs
*/
public void put(byte[] bs){
while((len+bs.length)>MaxNum){
MaxNum*=2;
byte[] newBytes = new byte[MaxNum];
System.arraycopy(bytes, 0, newBytes, 0, len);
bytes = newBytes;
}
System.arraycopy(bs,0,this.bytes,len,bs.length);
len+=bytes.length;
}
/**