Closed gancarani closed 10 months ago
WebSocket can only distinguish 2 message types: binary and text. Everything else needs to be handled in your code. You can, for example, wrap it in a JSON object, prefix with some identifier, etc.
This library only implements the WebSocket protocol which doesn't have such functionality.
Thanks, an in your opinion what would be the best way to handle different messages? Is there a pattern to use that is better than the others?
Closing as this is off topic I recommend asking this question in a general programming forum, not here.
**
Describe what you would like to know or do** A clear and concise description of what the problem is.
Describe the solution you'd considered A clear and concise description of any solutions you've considered.
Additional context Add any other context or links about the question here.