mirror of
https://github.com/unitoftime/rtcnet.git
synced 2025-12-24 13:18:11 +08:00
remove printout if eof error
This commit is contained in:
11
listener.go
11
listener.go
@@ -3,7 +3,9 @@ package rtcnet
|
||||
import (
|
||||
"crypto/tls"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
@@ -217,11 +219,12 @@ func (l *Listener) attemptWebRtcNegotiation(wsConn net.Conn) {
|
||||
for {
|
||||
n, err := wsConn.Read(buf)
|
||||
if err != nil {
|
||||
// TODO: Are there any cases where we might get an error here but its not fatal?
|
||||
if !errors.Is(err, io.EOF) {
|
||||
logger.Error().
|
||||
Err(err).
|
||||
Msg("error reading websocket")
|
||||
}
|
||||
// Assume the websocket is closed and break
|
||||
logger.Error().
|
||||
Err(err).
|
||||
Msg("error reading websocket")
|
||||
break
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user