mirror of
https://github.com/Links2004/arduinoWebSockets.git
synced 2025-07-13 23:36:30 +02:00
Initialize _reconnectInterval in constructor.
This allows setReconnectInterval() to be called before begin() and stops begin() from overriding _reconnectInterval every time it is called.
This commit is contained in:
@ -30,6 +30,7 @@ WebSocketsClient::WebSocketsClient() {
|
||||
_client.num = 0;
|
||||
_client.cIsClient = true;
|
||||
_client.extraHeaders = WEBSOCKETS_STRING("Origin: file://");
|
||||
_reconnectInterval = 500;
|
||||
}
|
||||
|
||||
WebSocketsClient::~WebSocketsClient() {
|
||||
@ -82,7 +83,6 @@ void WebSocketsClient::begin(const char * host, uint16_t port, const char * url,
|
||||
#endif
|
||||
|
||||
_lastConnectionFail = 0;
|
||||
_reconnectInterval = 500;
|
||||
}
|
||||
|
||||
void WebSocketsClient::begin(String host, uint16_t port, String url, String protocol) {
|
||||
|
Reference in New Issue
Block a user