Age | Commit message (Collapse) | Author |
|
The code got messy, clean it up.
Also, seems like Python 2.7+ support SIO_KEEPALIVE_VALS,
enable it's usage.
|
|
Newer OSX has Linux-style TCP_KEEPIDLE/TCP_KEEPCNT
socket options, but TCP_KEEPIDLE is missing, instead
it has old well-hidden TCP_KEEPALIVE option. So it
branches into Linux section and fails there.
This patch detects every Linux option separately
and uses TCP_KEEPALIVE instead TCP_KEEPIDLE
on Darwin.
It does expect that Python is compiled against current
OSX versions, and headers match running kernel. So if
option is defined in 'socket' module, it works.
Reported-by: Rob Fowler
|
|
|
|
Move set_tcp_keepalive() here, plus set_nonblocking() and
set_cloexec().
|