When a server broadcasts an event to a client, there is an option for a
callback function that may be used to let the client know that
the server has processed the event.
Although this is entirely managed by the server, the client can provide a list of return values to be provided to the callback
function that has been set up.
Simply having the handler function
return the desired values achieves this:.
@sio.event
def my_event(sid, data):
# handle the message
return "OK", 123
The wait() method can be used by an application if it has nothing to do
in the main thread and just wishes to wait until the server connection is broken
Name | Views | Likes |
---|---|---|
Base manager class in socket client | 116 | 0 |
JSON in socket client | 145 | 0 |
Parametrs in socket client | 110 | 0 |
Origin controls | 110 | 0 |
Standard threads in socket client | 122 | 0 |
uWSGI in socket client | 128 | 0 |
Examples of socket class | 122 | 0 |
Class samples | 134 | 0 |
Kombu in socket client | 128 | 0 |
Redis client | 121 | 0 |
Message queue | 120 | 0 |
Asyncio server | 115 | 0 |
User sessions in socket client | 124 | 0 |
Server in socket client | 115 | 0 |
Rooms in socket client | 98 | 0 |
Debugging socket client | 101 | 0 |
Creating client instance | 93 | 0 |
Versions of socket client | 98 | 0 |
Protocols | 99 | 0 |
Background task management | 106 | 0 |
Event callback in socket client | 145 | 0 |
Installing socket client | 117 | 0 |
Package socket client | 104 | 0 |
Library socket client | 101 | 0 |
Python library Socket client | 102 | 0 |
Comments