fix: connection reset without any closing handshake on clientside (#2709)
This commit is contained in:
@@ -317,6 +317,8 @@ func (s *RTCService) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
defer func() {
|
defer func() {
|
||||||
// when the source is terminated, this means Participant.Close had been called and RTC connection is done
|
// when the source is terminated, this means Participant.Close had been called and RTC connection is done
|
||||||
// we would terminate the signal connection as well
|
// we would terminate the signal connection as well
|
||||||
|
closeMsg := websocket.FormatCloseMessage(websocket.CloseNormalClosure, "")
|
||||||
|
_ = conn.WriteControl(websocket.CloseMessage, closeMsg, time.Now().Add(time.Second))
|
||||||
_ = conn.Close()
|
_ = conn.Close()
|
||||||
}()
|
}()
|
||||||
defer func() {
|
defer func() {
|
||||||
|
|||||||
Reference in New Issue
Block a user