--- stomp.py-2.0.4.old/stomp/stomp.py 2009-10-01 03:47:43.000000000 +0800 +++ stomp.py-2.0.4/stomp/stomp.py 2009-12-09 17:20:00.000000000 +0800 @@ -35,6 +35,8 @@ log = DevNullLogger() +_SocketFactory=socket.socket + class Connection(object): """ Represents a STOMP client connection. @@ -622,7 +624,7 @@ for host_and_port in self.__host_and_ports: try: log.debug("Attempting connection to host %s, port %s" % host_and_port) - self.__socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + self.__socket = _SocketFactory(socket.AF_INET, socket.SOCK_STREAM) if self.__ssl: # wrap socket if self.__ssl_ca_certs: cert_validation = ssl.CERT_REQUIRED