Fix вход
This commit is contained in:
@@ -25,10 +25,10 @@ public class PlayerSocketSendingThread extends Thread {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void send(DataPacket packet){
|
public void send(DataPacket packet){
|
||||||
list.addLast(packet);
|
list.addFirst(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isClose = false;
|
private boolean isClose = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -57,8 +57,14 @@ public class PlayerSocketSendingThread extends Thread {
|
|||||||
|
|
||||||
public void close(){
|
public void close(){
|
||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
while (list.size() <= 15 && !list.isEmpty() && System.currentTimeMillis() - start <= 1000L){}
|
while ((list.size() <= 15 && !list.isEmpty()) || System.currentTimeMillis() - start <= 1000L){
|
||||||
|
try {
|
||||||
|
Thread.sleep(10);
|
||||||
|
}catch (Exception ignore){}
|
||||||
|
}
|
||||||
|
|
||||||
isClose = true;
|
isClose = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
outputStream.close();
|
outputStream.close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user