mirror of
https://github.com/ergochat/ergo.git
synced 2024-12-26 04:32:36 +01:00
instantiate clients in the server command goroutine
This commit is contained in:
parent
dc5e258f88
commit
d5c9681a10
@ -122,7 +122,10 @@ func (s *Server) listen(config ListenerConfig) {
|
||||
if DEBUG_SERVER {
|
||||
log.Print("Server.Accept: ", conn.RemoteAddr())
|
||||
}
|
||||
NewClient(s, conn)
|
||||
|
||||
s.commands <- &NewClientCommand{
|
||||
conn: conn,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -534,3 +537,12 @@ func (msg *NoticeCommand) HandleServer(server *Server) {
|
||||
}
|
||||
target.Reply(RplNotice(client, target, msg.message))
|
||||
}
|
||||
|
||||
type NewClientCommand struct {
|
||||
BaseCommand
|
||||
conn net.Conn
|
||||
}
|
||||
|
||||
func (msg *NewClientCommand) HandleServer(server *Server) {
|
||||
NewClient(server, conn)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user