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

Behavior difference between html and io for send #282

Open
aeb-dev opened this issue Aug 13, 2023 · 0 comments
Open

Behavior difference between html and io for send #282

aeb-dev opened this issue Aug 13, 2023 · 0 comments

Comments

@aeb-dev
Copy link

aeb-dev commented Aug 13, 2023

WebSocketChannel webSocket = HtmlWebSocketChannel.connect("ws://localhost:5032/ws");
// WebSocketChannel webSocket = IOWebSocketChannel.connect("ws://localhost:5032/ws");
await webSocket.ready;

while (true) {
  webSocket.sink.add([1,2]);
  // webSocket.sink.add(Uint8List.fromList([1,2]));
  await Future.delayed(Duration(seconds: 5));
}

With the above code html version sends text messages but io version sends binary messages.

In order to get the same behavior
webSocket.sink.add(Uint8List.fromList([1,2])); this line has to be used.

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

No branches or pull requests

1 participant