On Monday, February 14, 2011 6:54:28 PM UTC-5, Massimo Di Pierro wrote: > > The problem that the web server needs to keep many connections open > (whether long polling or websocket) and a normal web server cannot > handle the traffic because of too many threads. It requires an async > server like tornado and/or lightweight threads like erlang or node.js. > > Implementing it in web2py would be pointless. Yet web2py can work as > middlewere and work with tornado as in the example.
Got it. I assume Tornado would handle all the back-and-forth messaging without involving web2py, but assuming you only need to authenticate once when the socket is first opened (i.e., not every time a message is sent through the socket), might it be feasible to involve web2py in the initial authentication? Or otherwise, could Tornado handle the authentication directly (i.e., confirm the user is logged in before establishing the socket connection) -- would it have to access the web2py session file to do that? Thanks. Anthony

