Note that there are some explanatory texts on larger screens.

plurals
  1. POtornado websockets ioloop exception
    primarykey
    data
    text
    <p>I'm trying to get the hello-world example from the tornado websockets docs working. I'm pretty new to tornado, and totally new to websockets. I have specified the following handler, straight from the docs:</p> <pre><code>class EchoWebSocket(tornado.websocket.WebSocketHandler): def open(self): print "WebSocket opened" def on_message(self, message): self.write_message(u"You said: " + message) def on_close(self): print "WebSocket closed" </code></pre> <p>and call it from javascript using </p> <pre><code>var ws = new WebSocket("ws://localhost:6665/websocket"); ws.onopen = function() { ws.send("Hello, world"); }; ws.onmessage = function (evt) { alert(evt.data); }; </code></pre> <p>also straight from the docs. I immediately hit three exceptions:</p> <pre><code>[E 111123 17:45:54 iostream:233] Uncaught exception, closing connection. Traceback (most recent call last): File "/local/lib/python2.5/site-packages/tornado/iostream.py", line 230, in _run_callback callback(*args, **kwargs) File "/local/lib/python2.5/site-packages/tornado/stack_context.py", line 173, in wrapped callback(*args, **kwargs) File "/local/lib/python2.5/site-packages/tornado/httpserver.py", line 353, in _on_headers self.request_callback(self._request) File "/local/lib/python2.5/site-packages/tornado/web.py", line 1182, in __call__ handler = spec.handler_class(self, request, **spec.kwargs) TypeError: default __new__ takes no parameters [E 111123 17:45:54 iostream:221] Uncaught exception, closing connection. Traceback (most recent call last): File "/local/lib/python2.5/site-packages/tornado/iostream.py", line 199, in _handle_events self._handle_read() File "/local/lib/python2.5/site-packages/tornado/iostream.py", line 258, in _handle_read if self._read_from_buffer(): File "/local/lib/python2.5/site-packages/tornado/iostream.py", line 325, in _read_from_buffer self._consume(loc + delimiter_len)) File "/local/lib/python2.5/site-packages/tornado/iostream.py", line 230, in _run_callback callback(*args, **kwargs) File "/local/lib/python2.5/site-packages/tornado/stack_context.py", line 173, in wrapped callback(*args, **kwargs) File "/local/lib/python2.5/site-packages/tornado/httpserver.py", line 353, in _on_headers self.request_callback(self._request) File "/local/lib/python2.5/site-packages/tornado/web.py", line 1182, in __call__ handler = spec.handler_class(self, request, **spec.kwargs) TypeError: default __new__ takes no parameters [E 111123 17:45:54 ioloop:281] Exception in I/O handler for fd 4 Traceback (most recent call last): File "/local/lib/python2.5/site-packages/tornado/ioloop.py", line 269, in start self._handlers[fd](fd, events) File "/local/lib/python2.5/site-packages/tornado/stack_context.py", line 173, in wrapped callback(*args, **kwargs) File "/local/lib/python2.5/site-packages/tornado/iostream.py", line 199, in _handle_events self._handle_read() File "/local/lib/python2.5/site-packages/tornado/iostream.py", line 258, in _handle_read if self._read_from_buffer(): File "/local/lib/python2.5/site-packages/tornado/iostream.py", line 325, in _read_from_buffer self._consume(loc + delimiter_len)) File "/local/lib/python2.5/site-packages/tornado/iostream.py", line 230, in _run_callback callback(*args, **kwargs) File "/local/lib/python2.5/site-packages/tornado/stack_context.py", line 173, in wrapped callback(*args, **kwargs) File "/local/lib/python2.5/site-packages/tornado/httpserver.py", line 353, in _on_headers self.request_callback(self._request) File "/local/lib/python2.5/site-packages/tornado/web.py", line 1182, in __call__ handler = spec.handler_class(self, request, **spec.kwargs) TypeError: default __new__ takes no parameters </code></pre> <p>which I confess to being unable to properly parse, and I'm nervous to dip into tornado.web. Is there something obvious I'm doing wrong? I'm using tornado 1.2.1.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload