MCPcopy Create free account
hub / github.com/Ramos-dev/OSSTunnel / run

Method run

client/src/test/java/A.java:34–76  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

32 }
33
34 public void run() {
35
36 Socket socket = null;
37 DataInputStream input = null;
38
39 try {
40 socket = serverSocket.accept();
41 socket.setKeepAlive(true);
42
43 while (true) {
44 input = new DataInputStream(socket.getInputStream());
45 byte[] buffer = {};
46 int bufflenth = input.available();
47 int size = 0;
48 while (bufflenth != 0) {
49 // 初始化byte数组为buffer中数据的长度
50 buffer = new byte[bufflenth];
51 size += input.read(buffer);
52 bufflenth = input.available();
53 }
54 if (buffer.length != 0) {
55
56 }
57
58 }
59 } catch (Exception e) {
60 e.printStackTrace();
61 } finally {
62 try {
63 if (input != null) {
64 input.close();
65 input = null;
66 }
67 if (socket != null) {
68 socket.close();
69 socket = null;
70 }
71 } catch (IOException e) {
72 // TODO Auto-generated catch block
73 e.printStackTrace();
74 }
75 }
76 }
77 }
78}

Callers 1

mainMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected