on_open and open of tornado.websocket.WebSocketHandler
94 views
Skip to first unread message
shinriyo
unread,
May 20, 2012, 12:28:31 PM5/20/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Tornado Web Server
Hi there
I read Introduction to tornado book
I use websocket and extend the tornado.websocket.WebSocketHandler
class.
It have open and on_open methods.
They are same? or different?
or I guess they are alias method
Thank you.
Ben Darnell
unread,
May 20, 2012, 1:32:48 PM5/20/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to python-...@googlegroups.com
It's just open(); there is no on_open(). The other methods are
on_message() and on_close() so it probably should have been on_open()
for consistency. (on the javascript side, the methods are onopen and
onmessage, without the underscore).
-Ben
Serge S. Koval
unread,
May 20, 2012, 6:22:48 PM5/20/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to python-...@googlegroups.com
While sockjs-tornado mimics tornado websocket API, but I decided to make it consistent with on_message/on_close, so it is called on_open.
Not a big deal to rename it to open() if someone will want to switch to native tornado websocket implementation.
Serge.
shinriyo
unread,
May 24, 2012, 10:19:14 PM5/24/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message