@@ -242,10 +242,6 @@ Set listener for socket close event, called when any sockets being closed, after
242
242
` void connect(const std::string& uri) `
243
243
244
244
Connect to socket.io server, eg. ` client.connect("ws://localhost:3000"); `
245
-
246
- ` void reconnect(const std::string& uri) `
247
-
248
- Try to reconnect with original session id. If ` fail listener ` triggered, means your session id is already expired, do not keep reconnect again.
249
245
250
246
` void close() `
251
247
@@ -259,6 +255,28 @@ Close the client, return until it is really closed.
259
255
260
256
Check if client's connection is opened.
261
257
258
+ #### Transparent reconnecting
259
+ ` void set_reconnect_attempts(int attempts) `
260
+
261
+ Set max reconnect attempts, set to 0 to disable transparent reconnecting.
262
+
263
+ ` void set_reconnect_delay(unsigned millis) `
264
+
265
+ Set minimum delay for reconnecting, this is the delay for 1st reconnecting attempt,
266
+ then the delay duration grows by attempts made.
267
+
268
+ ` void set_reconnect_delay_max(unsigned millis) `
269
+
270
+ Set maximum delay for reconnecting.
271
+
272
+ ` void set_reconnecting_listener(con_listener const& l) `
273
+
274
+ Set listener for reconnecting is in process.
275
+
276
+ ` void set_reconnect_listener(reconnect_listener const& l) `
277
+
278
+ Set listener for reconnecting event, called once a delayed connecting is scheduled.
279
+
262
280
#### Namespace
263
281
` socket::ptr socket(std::string const& nsp) `
264
282
0 commit comments