Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions logstash_async/transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def _close(self, force=False):
if not self._keep_connection or force:
if self._sock:
try:
self._wait_for_socket_buffer_empty()
#self._wait_for_socket_buffer_empty()
self._try_to_close_socket()
finally:
self._sock = None
Expand Down Expand Up @@ -163,7 +163,7 @@ def _is_sock_write_buff_empty(self):
# ----------------------------------------------------------------------
def _try_to_close_socket(self):
try:
self._sock.shutdown(socket.SHUT_WR)
#self._sock.shutdown(socket.SHUT_WR)
self._sock.close()
except Exception as exc:
self._log_close_socket_error(exc)
Expand Down Expand Up @@ -199,6 +199,15 @@ def __init__( # pylint: disable=too-many-arguments
self._certfile = certfile
self._ca_certs = ca_certs
self._timeout = timeout
# ----------------------------------------------------------------------
def _close(self, force=False):
if not self._keep_connection or force:
if self._sock:
try:
self._wait_for_socket_buffer_empty()
self._try_to_close_socket()
finally:
self._sock = None

# ----------------------------------------------------------------------
def _create_socket(self):
Expand Down