8000 Initialize _reconnectInterval in constructor. · BalloonWare/arduinoWebSockets@1268458 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1268458

Browse files
authored
Initialize _reconnectInterval in constructor.
This allows setReconnectInterval() to be called before begin() and stops begin() from overriding _reconnectInterval every time it is called.
1 parent 420cc55 commit 1268458

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/WebSocketsClient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ WebSocketsClient::WebSocketsClient() {
3030
_client.num = 0;
3131
_client.cIsClient = true;
3232
_client.extraHeaders = WEBSOCKETS_STRING("Origin: file://");
33+
_reconnectInterval = 500;
3334
}
3435

3536
WebSocketsClient::~WebSocketsClient() {
@@ -82,7 +83,6 @@ void WebSocketsClient::begin(const char * host, uint16_t port, const char * url,
8283
#endif
8384

8485
_lastConnectionFail = 0;
85-
_reconnectInterval = 500;
8686
}
8787

8888
void WebSocketsClient::begin(String host, uint16_t port, String url, String protocol) {

0 commit comments

Comments
 (0)
0