|
|
@ -307,17 +307,17 @@ class Client(object): |
|
|
|
:param event: The event name. It can be any string. The event names |
|
|
|
``'connect'``, ``'message'`` and ``'disconnect'`` are |
|
|
|
reserved and should not be used. |
|
|
|
:param data: The data to send to the client or clients. Data can be of |
|
|
|
type ``str``, ``bytes``, ``list`` or ``dict``. If a |
|
|
|
``list`` or ``dict``, the data will be serialized as JSON. |
|
|
|
:param data: The data to send to the server. Data can be of |
|
|
|
type ``str``, ``bytes``, ``list`` or ``dict``. To send |
|
|
|
multiple arguments, use a tuple where each element is of |
|
|
|
one of the types indicated above. |
|
|
|
:param namespace: The Socket.IO namespace for the event. If this |
|
|
|
argument is omitted the event is emitted to the |
|
|
|
default namespace. |
|
|
|
:param callback: If given, this function will be called to acknowledge |
|
|
|
the the client has received the message. The arguments |
|
|
|
the the server has received the message. The arguments |
|
|
|
that will be passed to the function are those provided |
|
|
|
by the client. Callback functions can only be used |
|
|
|
when addressing an individual client. |
|
|
|
by the server. |
|
|
|
|
|
|
|
Note: this method is not thread safe. If multiple threads are emitting |
|
|
|
at the same time on the same client connection, messages composed of |
|
|
@ -356,17 +356,17 @@ class Client(object): |
|
|
|
This function emits an event with the name ``'message'``. Use |
|
|
|
:func:`emit` to issue custom event names. |
|
|
|
|
|
|
|
:param data: The data to send to the client or clients. Data can be of |
|
|
|
type ``str``, ``bytes``, ``list`` or ``dict``. If a |
|
|
|
``list`` or ``dict``, the data will be serialized as JSON. |
|
|
|
:param data: The data to send to the server. Data can be of |
|
|
|
type ``str``, ``bytes``, ``list`` or ``dict``. To send |
|
|
|
multiple arguments, use a tuple where each element is of |
|
|
|
one of the types indicated above. |
|
|
|
:param namespace: The Socket.IO namespace for the event. If this |
|
|
|
argument is omitted the event is emitted to the |
|
|
|
default namespace. |
|
|
|
:param callback: If given, this function will be called to acknowledge |
|
|
|
the the client has received the message. The arguments |
|
|
|
the the server has received the message. The arguments |
|
|
|
that will be passed to the function are those provided |
|
|
|
by the client. Callback functions can only be used |
|
|
|
when addressing an individual client. |
|
|
|
by the server. |
|
|
|
""" |
|
|
|
self.emit('message', data=data, namespace=namespace, |
|
|
|
callback=callback) |
|
|
@ -377,9 +377,10 @@ class Client(object): |
|
|
|
:param event: The event name. It can be any string. The event names |
|
|
|
``'connect'``, ``'message'`` and ``'disconnect'`` are |
|
|
|
reserved and should not be used. |
|
|
|
:param data: The data to send to the client or clients. Data can be of |
|
|
|
type ``str``, ``bytes``, ``list`` or ``dict``. If a |
|
|
|
``list`` or ``dict``, the data will be serialized as JSON. |
|
|
|
:param data: The data to send to the server. Data can be of |
|
|
|
type ``str``, ``bytes``, ``list`` or ``dict``. To send |
|
|
|
multiple arguments, use a tuple where each element is of |
|
|
|
one of the types indicated above. |
|
|
|
:param namespace: The Socket.IO namespace for the event. If this |
|
|
|
argument is omitted the event is emitted to the |
|
|
|
default namespace. |
|
|
|