[infrastructure] add external null-annotations (#8848)
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
This commit is contained in:
@@ -126,8 +126,9 @@ public class PJLinkDevice {
|
||||
Instant now = Instant.now();
|
||||
Socket socket = this.socket;
|
||||
boolean connectionTooOld = false;
|
||||
if (this.socketCreatedOn != null) {
|
||||
long millisecondsSinceLastConnect = Duration.between(this.socketCreatedOn, now).toMillis();
|
||||
Instant socketCreatedOn = this.socketCreatedOn;
|
||||
if (socketCreatedOn != null) {
|
||||
long millisecondsSinceLastConnect = Duration.between(socketCreatedOn, now).toMillis();
|
||||
// according to the PJLink specification, the device closes the connection after 30s idle (without notice),
|
||||
// so to be on the safe side we do not reuse sockets older than 20s
|
||||
connectionTooOld = millisecondsSinceLastConnect > 20 * 1000;
|
||||
|
||||
Reference in New Issue
Block a user