Просмотр исходного кода

Changed receive() to recv() on Connection class to generalize the API

Taddeus Kroes 12 лет назад
Родитель
Сommit
a1721eeb57
2 измененных файлов с 2 добавлено и 3 удалено
  1. 2 2
      connection.py
  2. 0 1
      handshake.py

+ 2 - 2
connection.py

@@ -39,7 +39,7 @@ class Connection(object):
         else:
             self.sock.send(*message.fragment(fragment_size, mask=mask))
 
-    def receive(self):
+    def recv(self):
         """
         Receive a message. A message may consist of multiple (ordered) data
         frames. A control frame may be delivered at any time, also when
@@ -103,7 +103,7 @@ class Connection(object):
         """
         while True:
             try:
-                self.onmessage(self.receive())
+                self.onmessage(self.recv())
             except SocketClosed as e:
                 self.close(e.code, e.reason)
                 break

+ 0 - 1
handshake.py

@@ -237,7 +237,6 @@ class ClientHandshake(Handshake):
 
             self.wsock.protocol = protocol
 
-
     def handle_auth(self, headers):
         # HTTP authentication is required in the request
         hdr = headers['WWW-Authenticate']