summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavanum Srinivas <davanum@gmail.com>2016-03-28 06:38:11 -0400
committerDavanum Srinivas (dims) <davanum@gmail.com>2016-03-28 10:51:07 +0000
commitceda1f653630071c121d8c137f834be22a156fa3 (patch)
tree68eced98718f4cb1ddbb557998192591733650d3
parent7b558e5e99536f36e35ec64e3a88043fdffd620d (diff)
downloadoslo-messaging-ceda1f653630071c121d8c137f834be22a156fa3.tar.gz
Fix Break in Windows platforms4.6.1
In Ibf6139ac2c22d9eeda7030fb87b7f1139d92332e, we added a TCP timeout that does not work on Windows (with python 2.7.9) Closes-Bug: #1562706 Change-Id: I2819225c2d3d3b418c977c03868db8d0c8022d5a
-rw-r--r--oslo_messaging/_drivers/impl_rabbit.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/oslo_messaging/_drivers/impl_rabbit.py b/oslo_messaging/_drivers/impl_rabbit.py
index f48c2ad..faa49aa 100644
--- a/oslo_messaging/_drivers/impl_rabbit.py
+++ b/oslo_messaging/_drivers/impl_rabbit.py
@@ -20,6 +20,7 @@ import os
import random
import socket
import ssl
+import sys
import threading
import time
import uuid
@@ -867,8 +868,10 @@ class Connection(object):
LOG.debug('Failed to get socket attribute: %s' % str(e))
else:
sock.settimeout(timeout)
- sock.setsockopt(socket.IPPROTO_TCP, TCP_USER_TIMEOUT,
- timeout * 1000 if timeout is not None else 0)
+ if sys.platform != 'win32':
+ sock.setsockopt(socket.IPPROTO_TCP,
+ TCP_USER_TIMEOUT,
+ timeout * 1000 if timeout is not None else 0)
@contextlib.contextmanager
def _transport_socket_timeout(self, timeout):