Skip to content

Commit

Permalink
increase loogging, dead socket, invalid packets, echo req
Browse files Browse the repository at this point in the history
  • Loading branch information
Geosearchef committed Dec 16, 2021
1 parent e65e501 commit e75f29b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ private void checkerThread() {
}

if (System.currentTimeMillis() - lastPacketReceived > 10000) {
log.warn("Didn't receive any answer to echo requests for the past 10 seconds from {}, aborting connection", ice.getPeer().getRemoteLogin());
new Thread(ice::onConnectionLost).start();
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,11 @@ public void listener() {
sendViaIce(data, 0, packet.getLength());//Turn around, send echo back
}
} else {
log.warn(getLogPrefix() + "Received invalid packet, first byte: 0x{}", data[0]);
log.warn(getLogPrefix() + "Received invalid packet, first byte: 0x{}, length: {}", data[0], packet.getLength());
}

} catch (IOException e) {//TODO: nullpointer from localComponent.xxxx????
log.warn(getLogPrefix() + "Error while reading from ICE adapter");
log.warn(getLogPrefix() + "Error while reading from ICE adapter", e);
if(component == localComponent) {
onConnectionLost();
}
Expand Down

0 comments on commit e75f29b

Please sign in to comment.