Open xdeng opened 2 weeks ago
I would also like to ask how to implement timeout for the separated read-write close functions? Or context
raw, _:= dataChannel.Detach()
OnConnectionStateChange: disconnected ❌ for{ raw.Read()...//blocking } OnConnectionStateChange: failed ❌ for{ raw.Read()...//blocking }
Active call dataChannel.Close() ❌ for{ raw.Read()...//blocking } Active call raw.Close() ❌ for{ raw.Read()...//blocking } Active call peerConnection.Close() ✔ for{ raw.Read()...//Will fail and exit, will not block }
Your environment.
What did you do?
data-channels-detach
What did you expect?
What happened?
The connection status is
OnConnectionStateChange: disconnected OnConnectionStateChange: failed
dataChannel.Detach() ---> ReadWriteCloser, Why doesn't it fail when reading, but keeps blocking?
Need to call peerConnection.Close(), The read function will fail to exit.