When I should use Stream<WebSocket> or just WebSocket

19 views
Skip to first unread message

Tom William

unread,
Feb 28, 2020, 9:00:54 PM2/28/20
to Dart Server-side and Cloud Development
I see in this link
so when I should use this code:


HttpServer server;
server.listen((request) {
  if (...) {
    WebSocketTransformer.upgrade(request).then((websocket) {
      ...
    });
  } else {
    // Do normal HTTP request processing.
  }
});

and When I should use this code:



server.transform(new WebSocketTransformer()).listen((webSocket) => ...);


Assume I want to stream vedio from server side to client side?!
Reply all
Reply to author
Forward
0 new messages