Skip to content
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

move AsyncWebSocket's WS_EVT_CONNECT callback out of AsyncWebSocketClient's constructor #177

Closed
wants to merge 1 commit into from

Conversation

vortigont
Copy link
Collaborator

@vortigont vortigont commented Dec 19, 2024

  • this is wrong place to call user code from an object constructor
  • it is probably wrong to call AsyncWebSocket's method from other's objects constructor?
  • the callback is executed when new object is not yet linked to server's clients list

Closes #176

on the other hand all other events are also triggered similar way, but just not from a constructor. So moving out only one type of event probably also not that perfect. This might require to rethink it all?

…ient's constructor

 - this is wrong place to call user code from an object constructor
 - it is wrong to call AsyncWebSocket's method from other's objects constructor
 - the callback is executed when new object is not yet linked to server's clients list

Closes me-no-dev#176
@mathieucarbou
Copy link
Owner

We need to add a use case like #176 to test that in SimpleServer. I will do that later and merge.

@mathieucarbou
Copy link
Owner

@vortigont I cannot add commit in your fork. So I will push in a branch in this repo.

@mathieucarbou
Copy link
Owner

replaced by #179

@vortigont
Copy link
Collaborator Author

@vortigont I cannot add commit in your fork. So I will push in a branch in this repo.

oh... I think I need to remove my remote and push to your repo's branches to simplify this next time.
Thanks!

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.

Websocket com not correctly working
2 participants