制作图形界面

This commit is contained in:
Administrator
2022-12-25 14:53:46 +08:00
parent 0797da8eb3
commit 6dd349e722
106 changed files with 13020 additions and 312 deletions
@@ -1,5 +1,7 @@
package org.kne.cloud.network.klalb;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;
import java.net.UnknownHostException;
@@ -14,6 +16,12 @@ public class RemoteTCPConnection extends TCPConnection {
public RemoteTCPConnection(Tunnel t) throws UnknownHostException, IOException {
this(t, t.connectClientSocket());
}
@Override
protected void initIO() throws IOException {
dout = new DataOutputStream(new OutputMetre( connect.getOutputStream()));
din = new DataInputStream(new InputMetre(connect.getInputStream()));
}
public RemoteTCPConnection(Tunnel t, Socket s) throws UnknownHostException, IOException {
super(s);
@@ -47,8 +55,7 @@ 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.cuid);
}
dout.writeLong(data.number);
if (data.number > 0) {
@@ -83,9 +90,9 @@ public class RemoteTCPConnection extends TCPConnection {
KLALBBlock klb = new KLALBBlock();
klb.sn = din.readLong();
if(klb.sn!=0) {
klb.cuid = new UUID(din.readLong(), din.readLong());
klb.cuid = din.readLong();
}else {
klb.cuid=new UUID(0,0);
klb.cuid=0;
}
klb.number = din.readLong();
if (klb.number > 0) {