detachSocket method

Future<Socket> detachSocket (
  1. {bool writeHeaders = true}
)

Detaches the underlying socket from the HTTP server. When the socket is detached the HTTP server will no longer perform any operations on it.

This is normally used when a HTTP upgrade request is received and the communication should continue with a different protocol.

If writeHeaders is true, the status line and headers will be written to the socket before it's detached. If false, the socket is detached immediately, without any data written to the socket. Default is true.

Implementation

Future<Socket> detachSocket({bool writeHeaders = true});

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.13.0/dart-io/HttpResponse/detachSocket.html