Skip to content

Commit 32cb43a

Browse files
Try disconnecting gracefully from the server on shutdown
1 parent c872497 commit 32cb43a

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/main/java/com/teragrep/rlp_09/RelpThread.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ public void run() {
9494
}
9595
messagesSent.addAndGet(relpConfig.batchSize);
9696
}
97+
try {
98+
relpConnection.disconnect();
99+
} catch (IOException | TimeoutException e) {
100+
System.out.printf("[%s] Failed to disconnect from the server%n", name);
101+
}
97102
}
98103

99104
public void connect() {

0 commit comments

Comments
 (0)