mirror of
https://github.com/Qortal/qortal.git
synced 2025-07-30 05:31:23 +00:00
waiting and retrying clogged write channels
This commit is contained in:
@@ -31,7 +31,20 @@ public class ChannelWriteTask implements Task {
|
|||||||
@Override
|
@Override
|
||||||
public void perform() throws InterruptedException {
|
public void perform() throws InterruptedException {
|
||||||
try {
|
try {
|
||||||
boolean isSocketClogged = peer.writeChannel();
|
|
||||||
|
boolean isSocketClogged;
|
||||||
|
do {
|
||||||
|
isSocketClogged = peer.writeChannel();
|
||||||
|
|
||||||
|
if (isSocketClogged) {
|
||||||
|
LOGGER.info(
|
||||||
|
"socket is clogged: peer = {} {}, retrying",
|
||||||
|
peer.getPeerData().getAddress().toString(),
|
||||||
|
Thread.currentThread().getName()
|
||||||
|
);
|
||||||
|
Thread.sleep(1000);
|
||||||
|
}
|
||||||
|
} while( isSocketClogged );
|
||||||
|
|
||||||
// Tell Network that we've finished
|
// Tell Network that we've finished
|
||||||
Network.getInstance().notifyChannelNotWriting(socketChannel);
|
Network.getInstance().notifyChannelNotWriting(socketChannel);
|
||||||
|
Reference in New Issue
Block a user