mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-04-27 05:15:47 +00:00
cleanup
This commit is contained in:
@@ -112,12 +112,11 @@ ClientRead:
|
|||||||
byteCount, err := client.Read(buffer)
|
byteCount, err := client.Read(buffer)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
//NOTE(jwetzell) we hit deadline
|
|
||||||
if opErr, ok := err.(*net.OpError); ok {
|
if opErr, ok := err.(*net.OpError); ok {
|
||||||
|
//NOTE(jwetzell) we hit deadline
|
||||||
if opErr.Timeout() {
|
if opErr.Timeout() {
|
||||||
continue ClientRead
|
continue ClientRead
|
||||||
}
|
}
|
||||||
fmt.Println(opErr.Err)
|
|
||||||
if errors.Is(opErr, syscall.ECONNRESET) {
|
if errors.Is(opErr, syscall.ECONNRESET) {
|
||||||
ts.connectionsMu.Lock()
|
ts.connectionsMu.Lock()
|
||||||
for i := 0; i < len(ts.connections); i++ {
|
for i := 0; i < len(ts.connections); i++ {
|
||||||
@@ -126,7 +125,7 @@ ClientRead:
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
slog.Debug("connection closed", "id", ts.config.Id, "remoteAddr", client.RemoteAddr().String())
|
slog.Debug("connection reset", "id", ts.config.Id, "remoteAddr", client.RemoteAddr().String())
|
||||||
ts.connectionsMu.Unlock()
|
ts.connectionsMu.Unlock()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -139,7 +138,7 @@ ClientRead:
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
slog.Debug("connection closed", "id", ts.config.Id, "remoteAddr", client.RemoteAddr().String())
|
slog.Debug("stream ended", "id", ts.config.Id, "remoteAddr", client.RemoteAddr().String())
|
||||||
ts.connectionsMu.Unlock()
|
ts.connectionsMu.Unlock()
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user