Skip to content

Commit

Permalink
fix onConnect callback
Browse files Browse the repository at this point in the history
  • Loading branch information
Allenxuxu committed Dec 18, 2019
1 parent f19d021 commit fbd23e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ func (s *Server) handleNewConnection(fd int, sa *unix.Sockaddr) {

c := connection.New(fd, loop, sa, s.opts.Protocol, s.callback.OnMessage, s.callback.OnClose)

s.callback.OnConnect(c)
if err := loop.AddSocketAndEnableRead(fd, c); err != nil {
log.Error("[AddSocketAndEnableRead]", err)
}
s.callback.OnConnect(c)
}

// Start 启动 Server
Expand Down

0 comments on commit fbd23e5

Please sign in to comment.