sockjs.tornado.session¶
sockjs.tornado.session¶
SockJS session implementation.
Base Session¶
Constructor¶
Handlers¶
- BaseSession.set_handler(handler)[source]¶
Set transport handler handler
Handler, should derive from the sockjs.tornado.transports.base.BaseTransportMixin.
Messaging¶
- BaseSession.send_message(msg, stats=True, binary=False)[source]¶
Send or queue outgoing message
- msg
- Message to send
- stats
- If set to True, will update statistics after operation completes
Connection Session¶
- class sockjs.tornado.session.Session(conn, server, session_id, expiry=None)[source]¶
SockJS session implementation.
Constructor¶
Session¶
Handlers¶
- Session.set_handler(handler, start_heartbeat=True)[source]¶
Set active handler for the session
- handler
- Associate active Tornado handler with the session
- start_heartbeat
- Should session start heartbeat immediately
Messaging¶
- Session.send_message(msg, stats=True, binary=False)[source]¶
Send or queue outgoing message
- msg
- Message to send
- stats
- If set to True, will update statistics after operation completes
State¶
Utilities¶
- class sockjs.tornado.session.ConnectionInfo(ip, cookies, arguments, headers, path)[source]¶
Connection information object.
Will be passed to the on_open handler of your connection class.
Has few properties:
- ip
- Caller IP address
- cookies
- Collection of cookies
- arguments
- Collection of the query string arguments
- headers
- Collection of explicitly exposed headers from the request including: origin, referer, x-forward-for (and associated headers)
- path
- Request uri path