Skip to content

WebSocket Server is not closing properly!! #610

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

Nathan-ma
Copy link

I had to change a few things in order to make this lib work on esp8266 on Async mode using platformio.

But the main reason on this pull request is the mistake on line 916 on WebSocketsServer, the function is calling itself in a eternal loop that will end up eventually breaking the code.

Fix is simple, instead of WebSocketServer::close(), just reference to the proper one WebSocketServerCore::close().

    WSclient_t * newClient(WEBSOCKETS_NETWORK_CLASS * TCPclient);
Is now public
@@ -913,7 +913,7 @@ void WebSocketsServer::begin(void) {
}

void WebSocketsServer::close(void) {
WebSocketsServer::close();
WebSocketsServerCore::close();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I apologize for the mistake !

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad I could Help!

@Links2004
Copy link
Owner

ok the github build in conflict resolver bad. changes all line space and line endings...

Links2004 added a commit that referenced this pull request Jan 19, 2021
@Links2004
Copy link
Owner

changes have been manually merge to master

@Links2004 Links2004 closed this Jan 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants