Skip to content

An exception if the server sends message when connecting #1571

@Claus1

Description

@Claus1
//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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions