mirror of
https://git.zelz.net/catfoolyou/Project164.git
synced 2025-12-14 08:57:42 +00:00
sp-server
This commit is contained in:
46
sp-server/src_aux/TcpWriterThread.java
Normal file
46
sp-server/src_aux/TcpWriterThread.java
Normal file
@@ -0,0 +1,46 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
class TcpWriterThread extends Thread {
|
||||
final TcpConnection theTcpConnection;
|
||||
|
||||
TcpWriterThread(TcpConnection par1TcpConnection, String par2Str) {
|
||||
super(par2Str);
|
||||
this.theTcpConnection = par1TcpConnection;
|
||||
}
|
||||
|
||||
public void run() {
|
||||
TcpConnection.field_74469_b.getAndIncrement();
|
||||
|
||||
try {
|
||||
while (TcpConnection.isRunning(this.theTcpConnection)) {
|
||||
boolean var1;
|
||||
|
||||
for (var1 = false; TcpConnection.sendNetworkPacket(this.theTcpConnection); var1 = true) {
|
||||
;
|
||||
}
|
||||
|
||||
try {
|
||||
if (var1 && TcpConnection.getOutputStream(this.theTcpConnection) != null) {
|
||||
TcpConnection.getOutputStream(this.theTcpConnection).flush();
|
||||
}
|
||||
} catch (IOException var8) {
|
||||
if (!TcpConnection.isTerminating(this.theTcpConnection)) {
|
||||
TcpConnection.sendError(this.theTcpConnection, var8);
|
||||
}
|
||||
|
||||
var8.printStackTrace();
|
||||
}
|
||||
|
||||
try {
|
||||
sleep(2L);
|
||||
} catch (InterruptedException var7) {
|
||||
;
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
TcpConnection.field_74469_b.getAndDecrement();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user