@@ -74,19 +74,24 @@ server::
74
74
print("I'm connected!")
75
75
76
76
@sio.event
77
- def connect_error():
77
+ def connect_error(data ):
78
78
print("The connection failed!")
79
79
80
80
@sio.event
81
81
def disconnect():
82
82
print("I'm disconnected!")
83
83
84
- Note that the ``disconnect `` handler is invoked for application initiated
85
- disconnects, server initiated disconnects, or accidental disconnects, for
86
- example due to networking failures. In the case of an accidental
87
- disconnection, the client is going to attempt to reconnect immediately after
88
- invoking the disconnect handler. As soon as the connection is re-established
89
- the connect handler will be invoked once again.
84
+ The ``connect_error `` handler is invoked when a connection attempt fails. If
85
+ the server provides arguments, these are passed on to the handler. The server
86
+ can use an argument to provide information to the client regarding the
87
+ connection failure.
88
+
89
+ The ``disconnect `` handler is invoked for application initiated disconnects,
90
+ server initiated disconnects, or accidental disconnects, for example due to
91
+ networking failures. In the case of an accidental disconnection, the client is
92
+ going to attempt to reconnect immediately after invoking the disconnect
93
+ handler. As soon as the connection is re-established the connect handler will
94
+ be invoked once again.
90
95
91
96
If the server includes arguments with an event, those are passed to the
92
97
handler function as arguments.
0 commit comments