Jeffrey Gelens avatar Jeffrey Gelens committed 8e23fe7 Merge

Merge default branch to stable

Comments (0)

Files changed (2)

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

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:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.