transport.socket fixes
authorTero Marttila <terom@fixme.fi>
Sun, 23 Aug 2009 22:31:57 +0300
changeset 33 c71de00715d6
parent 32 2168a9ffaef7
child 34 5ce1f16ee3fa
transport.socket fixes
qmsk/net/transport/socket.py
--- a/qmsk/net/transport/socket.py	Sun Aug 23 22:31:43 2009 +0300
+++ b/qmsk/net/transport/socket.py	Sun Aug 23 22:31:57 2009 +0300
@@ -87,7 +87,7 @@
 
         try :
             # socket()
-            sock = self._socket(ai.family, ai.socktype, ai.protocol)
+            sock = cls._socket(ai.family, ai.socktype, ai.protocol)
 
             # bind()
             sock.bind(ai.addr)
@@ -117,7 +117,7 @@
         errors = []
         
         # resolve the endpoint and try socket+bind
-        for ai in endpoint.getaddrinfo(family, socktype, protocol, AI_PASSIVE) :
+        for ai in endpoint.resolve(family, socktype, protocol, AI_PASSIVE) :
             try :
                 # try to socket+bind this addrinfo
                 sock = cls._bind_addrinfo(ai)
@@ -260,7 +260,7 @@
         errors = []
         
         # resolve the endpoint and try socket+bind
-        for ai in endpoint.getaddrinfo(family, socktype, protocol) :
+        for ai in endpoint.resolve(family, socktype, protocol) :
             try :
                 # try to connect the socket to this addrinfo
                 cls._connect_sock_addrinfo(sock, ai)
@@ -281,7 +281,7 @@
             raise SocketConnectEndpointError(endpoint, errors)
     
     @classmethod
-    def _connect_endpoint (self, endpoint, family, socktype, protocol = 0) :
+    def _connect_endpoint (cls, endpoint, family, socktype, protocol = 0) :
         """
             Create a new socket and connect it to the given remote endpoint, using the given parameters to resolve the
             endpoint.
@@ -290,7 +290,7 @@
         errors = []
         
         # resolve the endpoint and try socket+bind
-        for ai in endpoint.getaddrinfo(family, socktype, protocol) :
+        for ai in endpoint.resolve(family, socktype, protocol) :
             try :
                 # try to socket+connect this addrinfo
                 sock = cls._connect_addrinfo(ai)