Closed PieceOfGood closed 2 years ago
You can pass a Message::Close
through the Sink
part. If you look at the code of WebSocketStream::close
, that's literally what it does :)
Sink::close
comes from SinkExt
and just closes the connection directly.
Does that help?
Yes, that's what I need. Thanks a lot!
For a simple situation, the
close()
method needs to passCloseFrame
:But if I call split() for
ws_stream
to create tasks with their participation, methodclose()
stops taking arguments, what throws an exception on the echo server side, like this:websockets.exceptions.ConnectionClosedError: received 1005 (no status code [internal]); then sent 1005 (no status code [internal])
The server continues to run, but in its console it is always an exception when the connection is terminated in the last way.