Class socketio.polling
socket.io polling transport Most basic transport, HTTP GET long-polling the socket.io's server to receive events and perfoming HTTP POSTs to send.
Used by socketio.manager
Functions
C.new (opts) | Class constructor. |
Methods
socketio.polling:send (self, pkt) | Queue a packet to send to the socket.io server. |
socketio.polling:open (self) | Open the transport. |
socketio.polling:close (self) | Close the transport. |
socketio.polling:set_session (self, session) | Set a current session. |
socketio.polling:clear_session (self) | Clear/Forget the current session. |
Functions
- C.new (opts)
-
Class constructor.
Parameters:
- opts Options given to socketio.manager
- on_packet Function called when a new packet is received. First and unique argument is the still encoded packet. Function will run in its own copas thread.
- on_error Function called when an error occurs on the transport level. Function will run in its own copas thread.
- opts Options given to socketio.manager
Methods
- socketio.polling:send (self, pkt)
-
Queue a packet to send to the socket.io server.
Parameters:
- self instance
- pkt Already-encoded packet.
- socketio.polling:open (self)
-
Open the transport. Start long-polling the server.
Parameters:
- self instance
- socketio.polling:close (self)
-
Close the transport. Stop every communication with the server.
Parameters:
- self instance
- socketio.polling:set_session (self, session)
-
Set a current session.
Parameters:
- self instance
- session Session information.
- session_id Session ID defined by the server.
- ping_timeout Timeout after a unanswered PING, in second, defined by the server.
- ping_interval Interval between every PINGs, in second, defined by the server.
- upgrades Table of transport upgrade proposed by the server.
- socketio.polling:clear_session (self)
-
Clear/Forget the current session.
Parameters:
- self instance