Closed vfiruz97 closed 1 month ago
It seems like the issue lies within the _messageFrameEnd method in the _WebSocketProtocolTransformer class, specifically when decoding bytes. Sometimes, the byte list contains numbers larger than 128, leading to errors and potentially causing the connection to close or unexpected characters to appear.
_eventSink!.add(utf8.decode(bytes));
That seems to be the culprit.
Issue Description: When attempting to use the web_socket_channel package in Dart to establish a WebSocket connection to the server wss://mob-backdev.dentro.ru:444, unexpected behavior occurs similar to what was experienced with the Dart WebSocket class. Although the server is expected to echo the sent messages, the received data is inconsistent, and sometimes the connection closes prematurely with a SocketException.
Steps to Reproduce:
Expected Behavior:
Actual Behavior:
Additional Information:
Code Snippet:
Outputs:
Test in Postman
https://github.com/dart-lang/io/assets/43540889/236c4804-d3be-43ee-9894-567a5fdd40d4