go-socket.io
go-socket.io copied to clipboard
server how to close socket.io connection?
directly call Close()? When I directly call Close(), client will retry again. If I want to set code when server close socket.io connection, what should I do? THX!
Socket.io connection have method Close() for your case. Connection's instance available into handler method
client will retry again.
I am not sure for this behaviour.
what should I do?
Hm.... Good question. I don't know. We nedd some experiments with it case
Close() only stop accepting new connections, is there a way to close active connections ?
My program is stuck in graceful http shutdown, waiting srv.closeIdleConns()
https://pkg.go.dev/net/[email protected]#Server.Shutdown
How is it going now?
I have the similar issue for authentication, when I directly call Close() if authentication failed, the client will handle disconnect signal, so it will reconnect.
Or, is there any way to use middleware just like the javascript library.

Best Regards