Fix oslo.messaging for Mac OS X
TCP_USER_TIMEOUT is not defined on Mac OS X, so we should not set it on that platform. Change-Id: If745d4981dea24e4267c95473059ff71176ae7d9 Closes-Bug: #1566862
This commit is contained in:
parent
ee394d3c5b
commit
8afa73b43f
@ -868,7 +868,8 @@ class Connection(object):
|
|||||||
LOG.debug('Failed to get socket attribute: %s' % str(e))
|
LOG.debug('Failed to get socket attribute: %s' % str(e))
|
||||||
else:
|
else:
|
||||||
sock.settimeout(timeout)
|
sock.settimeout(timeout)
|
||||||
if sys.platform != 'win32':
|
# TCP_USER_TIMEOUT is not defined on Windows and Mac OS X
|
||||||
|
if sys.platform != 'win32' and sys.platform != 'darwin':
|
||||||
sock.setsockopt(socket.IPPROTO_TCP,
|
sock.setsockopt(socket.IPPROTO_TCP,
|
||||||
TCP_USER_TIMEOUT,
|
TCP_USER_TIMEOUT,
|
||||||
timeout * 1000 if timeout is not None else 0)
|
timeout * 1000 if timeout is not None else 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user