Commits

Jeffrey Gelens  committed 8e23fe7 Merge

Merge default branch to stable

  • Participants
  • Parent commits 59df1d3, e6bd95e
  • Branches stable

Comments (0)

Files changed (2)

File geventwebsocket/handler.py

         else:
             self.websocket_connection = True
 
-        self.websocket = WebSocket(self.rfile, self.wfile, self.socket, self.environ)
+        self.websocket = WebSocket(self.socket, self.rfile, self.environ)
         self.environ['wsgi.websocket'] = self.websocket
 
         # Detect the Websocket protocol

File geventwebsocket/websocket.py

 # Webkit-trunk support this version.
 
 class WebSocket(object):
-    def __init__(self, rfile, wfile, sock, environ):
+    def __init__(self, sock, rfile, environ):
         self.rfile = rfile
-        self.wfile = wfile
         self.socket = sock
         self.origin = environ.get('HTTP_ORIGIN')
         self.protocol = environ.get('HTTP_SEC_WEBSOCKET_PROTOCOL', 'unknown')
         else:
             raise Exception("Invalid message encoding")
 
-        self.wfile.write("\x00" + message + "\xFF")
+        self.socket.sendall("\x00" + message + "\xFF")
 
     def close_connection(self):
         if not self.websocket_closed: