8000 Gracefully close the socket. · delulu/fluent-logger-python@2fb58a6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2fb58a6

Browse files
committed
Gracefully close the socket.
Calling .shutdown on the socket before .close(), notifies the other end that we are closing down. It should also ease subsequent further startups, without dangling connections.
1 parent 0efc2fc commit 2fb58a6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fluent/sender.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ def clear_last_error(self, _thread_id = None):
197197

198198
def _close(self):
199199
if self.socket:
200+
self.socket.shutdown(socket.SHUT_RDWR)
200201
self.socket.close()
201202
self.socket = None
202203

0 commit comments

Comments
 (0)
0