When I should use Stream<WebSocket> or just WebSocket

Skip to first unread message

Tom William

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
0 new messages