Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
lDEVinux
GitHub Repository: lDEVinux/eaglercraft
Path: blob/main/sp-server/src_aux/TcpWriterThread.java
8641 views
1
package net.minecraft.src;
2
3
import java.io.IOException;
4
5
class TcpWriterThread extends Thread {
6
final TcpConnection theTcpConnection;
7
8
TcpWriterThread(TcpConnection par1TcpConnection, String par2Str) {
9
super(par2Str);
10
this.theTcpConnection = par1TcpConnection;
11
}
12
13
public void run() {
14
TcpConnection.field_74469_b.getAndIncrement();
15
16
try {
17
while (TcpConnection.isRunning(this.theTcpConnection)) {
18
boolean var1;
19
20
for (var1 = false; TcpConnection.sendNetworkPacket(this.theTcpConnection); var1 = true) {
21
;
22
}
23
24
try {
25
if (var1 && TcpConnection.getOutputStream(this.theTcpConnection) != null) {
26
TcpConnection.getOutputStream(this.theTcpConnection).flush();
27
}
28
} catch (IOException var8) {
29
if (!TcpConnection.isTerminating(this.theTcpConnection)) {
30
TcpConnection.sendError(this.theTcpConnection, var8);
31
}
32
33
var8.printStackTrace();
34
}
35
36
try {
37
sleep(2L);
38
} catch (InterruptedException var7) {
39
;
40
}
41
}
42
} finally {
43
TcpConnection.field_74469_b.getAndDecrement();
44
}
45
}
46
}
47
48