Another batch of preemptive bugfixing

This commit is contained in:
ceikry 2021-07-26 07:33:07 -05:00
parent b151cb852b
commit 1b7c2914cb
19 changed files with 84 additions and 84 deletions

View file

@ -137,15 +137,15 @@ public class IoSession {
*/
public void queue(ByteBuffer buffer) {
try {
writingLock.tryLock(1000L, TimeUnit.MILLISECONDS);
if(writingLock.tryLock(1000L, TimeUnit.MILLISECONDS)){
writingQueue.add(buffer);
writingLock.unlock();
write();
}
} catch (Exception e){
e.printStackTrace();
writingLock.unlock();
return;
}
writingQueue.add(buffer);
writingLock.unlock();
write();
}
/**
@ -168,10 +168,11 @@ public class IoSession {
}
writingQueue.remove(0);
}
writingLock.unlock();
} catch (IOException e) {
disconnect();
writingLock.unlock();
}
writingLock.unlock();
}
/**