[Pkg-mpd-commits] [python-mpd] 104/262: mpd.py turn on tcp keepalive on tcp sockets

Simon McVittie smcv at debian.org
Sun May 22 18:16:31 UTC 2016


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch upstream
in repository python-mpd.

commit 621664b0be81341e9561c6bf3568148e24669ba6
Author: Jörg Thalheim <jthalheim at gmail.com>
Date:   Fri Feb 17 20:35:12 2012 +0100

    mpd.py turn on tcp keepalive on tcp sockets
    
    this is useful for idle connections:
        - Checking for dead peers (crashing, network problems...)
        - Prevent disconnection due network inactivity (server behind
          NAT/firewall)
---
 mpd.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mpd.py b/mpd.py
index 41ec15e..6995bb2 100644
--- a/mpd.py
+++ b/mpd.py
@@ -387,6 +387,7 @@ class MPDClient():
             sock = None
             try:
                 sock = socket.socket(af, socktype, proto)
+                sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
                 sock.connect(sa)
                 return sock
             except socket.error as e:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mpd/python-mpd.git



More information about the Pkg-mpd-commits mailing list