njones / socketio

A Modern SocketIO library for go
MIT License
60 stars 9 forks source link

socket-io: Panic sent on closed channel #78

Open heiningair opened 1 year ago

heiningair commented 1 year ago

Hi,

I noticed that sometimes when my application (which implements the socketio server) is running for some time, I experience a panic which states the following:

panic: send on closed channel

goroutine 6198 [running]:
github.com/njones/socketio/transport.(*Transport).Receive.func1()
    .../go/pkg/mod/github.com/njones/socketio@v0.1.4/transport/transport.go:154 +0x826
created by github.com/njones/socketio/transport.(*Transport).Receive
    .../go/pkg/mod/github.com/njones/socketio@v0.1.4/transport/transport.go:111 +0x76

I use the ServerV4 with PollingTransport.

Is that a known issue?

Even when the application is idle, it happens sometimes and crashes the whole app. How can I prevent this from happening?