Ver código fonte

Make register and unregister channels for the WS code not block so easily

Ask Bjørn Hansen 13 anos atrás
pai
commit
e33b350521
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      monitor.go

+ 2 - 2
monitor.go

@@ -29,8 +29,8 @@ type monitorHub struct {
 
 var hub = monitorHub{
 	broadcast:   make(chan string),
-	register:    make(chan *wsConnection),
-	unregister:  make(chan *wsConnection),
+	register:    make(chan *wsConnection, 10),
+	unregister:  make(chan *wsConnection, 10),
 	connections: make(map[*wsConnection]bool),
 }