Skip to content

Commit de0ac3b

Browse files
committed
update README for the reconnection API modification
1 parent 667f75d commit de0ac3b

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

README.md

+22-4
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,6 @@ Set listener for socket close event, called when any sockets being closed, after
242242
`void connect(const std::string& uri)`
243243

244244
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.
249245

250246
`void close()`
251247

@@ -259,6 +255,28 @@ Close the client, return until it is really closed.
259255

260256
Check if client's connection is opened.
261257

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+
262280
#### Namespace
263281
`socket::ptr socket(std::string const& nsp)`
264282

0 commit comments

Comments
 (0)