Skip to content

Commit

Permalink
Fix #1055 Socket Mode: ENOTSOCK every 300 minutes on Windows (#1091)
Browse files Browse the repository at this point in the history
  • Loading branch information
seratch authored Aug 13, 2021
1 parent b2364d2 commit 48602cf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion slack_sdk/socket_mode/builtin/internals.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ def receive(specific_buffer_size: Optional[int] = None):
logger.debug(f"Received bytes: {received_bytes}")
return received_bytes
except OSError as e:
if e.errno == errno.EBADF:
# For Linux/macOS, errno.EBADF is the expected error for bad connections.
# The errno.ENOTSOCK can be sent when running on Windows OS.
if e.errno in (errno.EBADF, errno.ENOTSOCK):
logger.debug("The connection seems to be already closed.")
return bytes()
raise e
Expand Down

0 comments on commit 48602cf

Please sign in to comment.