修复线程不能正确关闭的问题

This commit is contained in:
Administrator
2022-12-18 09:43:43 +08:00
parent e93a5815b4
commit 0797da8eb3
7 changed files with 48 additions and 14 deletions
@@ -46,8 +46,10 @@ public class RemoteTCPConnection extends TCPConnection {
public void sendBlock(KLALBBlock data) throws IOException {
dout.writeLong(data.sn);
if(data.sn!=0) {
dout.writeLong(data.cuid.getMostSignificantBits());
dout.writeLong(data.cuid.getLeastSignificantBits());
}
dout.writeLong(data.number);
if (data.number > 0) {
if (data.data == null) {
@@ -80,7 +82,11 @@ public class RemoteTCPConnection extends TCPConnection {
public KLALBBlock receiveBlock() throws IOException {
KLALBBlock klb = new KLALBBlock();
klb.sn = din.readLong();
if(klb.sn!=0) {
klb.cuid = new UUID(din.readLong(), din.readLong());
}else {
klb.cuid=new UUID(0,0);
}
klb.number = din.readLong();
if (klb.number > 0) {
int size = din.readInt();