mirror of https://github.com/schollz/croc.git
increase write wait
This commit is contained in:
parent
2946922fb5
commit
b469d5db4b
|
@ -10,7 +10,7 @@ import (
|
|||
|
||||
const (
|
||||
// Time allowed to write a message to the peer.
|
||||
writeWait = 10 * time.Second
|
||||
writeWait = 6000 * time.Second
|
||||
|
||||
// Time allowed to read the next pong message from the peer.
|
||||
pongWait = 6000 * time.Second
|
||||
|
|
|
@ -62,6 +62,7 @@ func (h *hub) run() {
|
|||
for connection := range h.rooms.rooms[s.room] {
|
||||
close(connection.send)
|
||||
}
|
||||
log.Debugf("deleting room %s", s.room)
|
||||
delete(h.rooms.rooms, s.room)
|
||||
}
|
||||
h.rooms.Unlock()
|
||||
|
@ -71,6 +72,7 @@ func (h *hub) run() {
|
|||
for connection := range h.rooms.rooms[s.room] {
|
||||
close(connection.send)
|
||||
}
|
||||
log.Debugf("deleting room %s", s.room)
|
||||
delete(h.rooms.rooms, s.room)
|
||||
h.rooms.Unlock()
|
||||
case m := <-h.broadcast:
|
||||
|
@ -86,6 +88,7 @@ func (h *hub) run() {
|
|||
close(c.send)
|
||||
delete(connections, c)
|
||||
if len(connections) == 0 {
|
||||
log.Debugf("deleting room %s", m.room)
|
||||
delete(h.rooms.rooms, m.room)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue