Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting SO_KEEPALIVE only for network connections #785

Merged
merged 1 commit into from
Mar 13, 2019

Conversation

ludgerheide
Copy link
Contributor

In the socket setup SO_KEEPALIVE (enabling TCP keepalive) is set after the if-branch between local unix and network sockets, setting it for both socket types. This works on Linux, but on Windows Subsystem for Linux, the sock.setsockopt() call returns EINVAL, which - while different from Linux - can be argued to make sense since a local unix socket can't really have a TCP keepalive setting.

By moving the SO_KEEPALIVE sock.setsockopt() call into the branch for network connections, it works on Wndows as well.

@methane methane merged commit 3674bc6 into PyMySQL:master Mar 13, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants