# Copyright (C) 2008-2010 J. Alexander Treuman <jat@spatialrift.net>
# Copyright (C) 2012-2019 Kaliko Jack <kaliko@azylum.org>
# Copyright (C) 2019 Naglis Jonaitis <naglis@mailbox.org>
+# Copyright (C) 2019 Bart Van Loon <bbb@bbbart.be>
#
# python-musicpd is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
ERROR_PREFIX = "ACK "
SUCCESS = "OK"
NEXT = "list_OK"
-VERSION = '0.4.4'
+VERSION = '0.4.5'
+CONNECTION_TIMEOUT = 5 # seconds before a tcp connection attempt times out
def iterator_wrapper(func):
sock = None
try:
sock = socket.socket(af, socktype, proto)
+ sock.settimeout(CONNECTION_TIMEOUT)
sock.connect(sa)
+ sock.settimeout(None)
return sock
except socket.error as socket_err:
err = socket_err