@@ -54,12 +54,34 @@ to coordinate operations such as broadcasting. The supported queues are
5454other message queues supported by the
5555`Kombu  <http://kombu.readthedocs.org/en/latest/ >`_ package.
5656
57- On the client-side, the official Socket.IO Javascript client library versions
58- 1.x or 2.x can be used to establish a connection to the server (work to support
59- the 3.x release is in progress). There are also official clients written in
60- Swift, Java and C++. Unofficial clients may also work, as long as they
61- implement the
57+ On the client-side, the official Socket.IO Javascript client library can be
58+ used to establish a connection to the server. There are also official clients
59+ written in Swift, Java and C++. Unofficial clients may also work, as long as
60+ they implement the
6261`Socket.IO protocol  <https://github.com/socketio/socket.io-protocol >`_.
62+ The `python-socketio  <https://github.com/miguelgrinberg/python-socketio >`_
63+ package includes a Python client.
64+ 
65+ Version compatibility
66+ --------------------- 
67+ 
68+ The Socket.IO protocol has been through a number of revisions, and some of these
69+ introduced backward incompatible changes, which means that the client and the
70+ server must use compatible versions for everything to work.
71+ 
72+ The version compatibility chart below maps versions of this package to versions
73+ of the JavaScript reference implementation and the versions of the Socket.IO and
74+ Engine.IO protocols.
75+ 
76+ +------------------------------+-----------------------------+-----------------------------+------------------------+-------------------------+ 
77+ |  JavaScript Socket.IO version |  Socket.IO protocol revision |  Engine.IO protocol revision |  Flask-SocketIO version |  python-socketio version | 
78+ +==============================+=============================+=============================+========================+=========================+ 
79+ |  0.9.x                        |  1, 2                        |  1, 2                        |  Not supported          |  Not supported           | 
80+ +------------------------------+-----------------------------+-----------------------------+------------------------+-------------------------+ 
81+ |  1.x and 2.x                  |  3, 4                        |  3                           |  4.x                    |  4.x                     | 
82+ +------------------------------+-----------------------------+-----------------------------+------------------------+-------------------------+ 
83+ |  3.x                          |  5                           |  4                           |  5.x                    |  5.x                     | 
84+ +------------------------------+-----------------------------+-----------------------------+------------------------+-------------------------+ 
6385
6486Initialization
6587-------------- 
@@ -118,8 +140,8 @@ The following example creates a server-side event handler for an unnamed
118140event::
119141
120142    @socketio.on('message') 
121-     def handle_message(message ): 
122-         print('received message: ' + message ) 
143+     def handle_message(data ): 
144+         print('received message: ' + data ) 
123145
124146The above example uses string messages. Another type of unnamed events use
125147JSON data::
@@ -137,10 +159,17 @@ these events can be string, bytes, int, or JSON::
137159
138160Custom named events can also support multiple arguments::
139161
140-     @socketio.on('my event ') 
162+     @socketio.on('my_event ') 
141163    def handle_my_custom_event(arg1, arg2, arg3): 
142164        print('received args: ' + arg1 + arg2 + arg3) 
143165
166+ When the name of the event is a valid Python identifier that does not collide
167+ with other defined symbols, the ``@socketio.event `` provides a more compact
168+ syntax that takes the event name from the decorated function::
169+ 
170+     @socketio.event 
171+     def my_custom_event(arg1, arg2, arg3): 
172+         print('received args: ' + arg1 + arg2 + arg3) 
144173
145174Named events are the most flexible, as they eliminate the need to include
146175additional metadata to describe the message type. The names ``message ``,
0 commit comments