We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d8a8227 commit 6e7f969Copy full SHA for 6e7f969
server.go
@@ -155,6 +155,8 @@ func (s *Server) acceptLoop() error {
155
// handles the message through the session in different goroutines,
156
// and waits until the session's closed, then close the conn.
157
func (s *Server) handleConn(conn net.Conn) {
158
+ defer conn.Close() // nolint
159
+
160
sess := newSession(conn, &sessionOption{
161
Packer: s.Packer,
162
Codec: s.Codec,
@@ -175,9 +177,6 @@ func (s *Server) handleConn(conn net.Conn) {
175
177
if s.OnSessionClose != nil {
176
178
go s.OnSessionClose(sess)
179
}
- if err := conn.Close(); err != nil {
- Log.Errorf("connection close err: %s", err)
180
- }
181
182
183
// Stop stops server. Closing Listener and all connections.
0 commit comments