Skip to content
New issue

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

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

Already on GitHub? # to your account

An exception if the server sends message when connecting #1571

Closed
Claus1 opened this issue Sep 14, 2019 · 3 comments
Closed

An exception if the server sends message when connecting #1571

Claus1 opened this issue Sep 14, 2019 · 3 comments

Comments

@Claus1
Copy link

Claus1 commented Sep 14, 2019

//server code
class GuiServer(WebSocket):
    def handleConnected(self):
        self.sendMessage(json(initInfo)) #init message

Without sending back initial message connection works, but with it I got the exception:
[ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: WebSocketChannelException: WebSocketChannelException: WebSocketException: Connection to 'http://localhost:1234#' was not upgraded to websocket
#0 new IOWebSocketChannel._withoutSocket.
package:web_socket_channel/io.dart:84
#1604 _invokeErrorHandler (dart:async/async_error.dart:17:29)
dart-archive/web_socket_channel#2 _HandleErrorStream._handleError (dart:async/stream_pipe.dart:286:9)
dart-archive/web_socket_channel#3 _ForwardingStreamSubscription._handleError (dart:async/stream_pipe.dart:168:13)
#1605 _rootRunBinary (dart:async/zone.dart:1144:38)
dart-archive/web_socket_channel#5 _CustomZone.runBinary (dart:async/zone.dart:1037:19)
dart-archive/web_socket_channel#6 _CustomZone.runBinaryGuarded (dart:async/zone.dart:939:7)
dart-archive/web_socket_channel#7 _BufferingStreamSubscription._sendError.sendError (dart:async/stream_impl.dart:355:15)
dart-archive/web_socket_channel#8 _BufferingStreamSubscription._sendError (dart:async/stream_impl.dart:373:16)
dart-archive/web_socket_channel#9 _BufferingStreamSubscription._addError (dart:async/stream_impl.dart:272:7)
dart-archive/web_socket_channel#10 _SyncStreamControllerDispatch._sendError (dart:async/stream_controller.dart:768:19)

@Claus1 Claus1 changed the title Exception If the server send message when connecting An exception if the server sends message when connecting Sep 14, 2019
@Claus1 Claus1 closed this as completed Sep 15, 2019
@biij5698
Copy link

+1

@hiren3897
Copy link

+1

Any solution so far?

@natebosch
Copy link
Member

Can anyone share a complete reproduction case for this?

@mosuem mosuem transferred this issue from dart-archive/web_socket_channel Jan 22, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

5 participants