200afffa7f
Also, removed a bunch of overly verbose logging
23 lines
336 B
Go
23 lines
336 B
Go
package main
|
|
|
|
import (
|
|
"code.google.com/p/go.net/websocket"
|
|
"log"
|
|
)
|
|
|
|
type Spectator struct {
|
|
ws *websocket.Conn
|
|
send chan *Boardstate
|
|
}
|
|
|
|
func (s *Spectator) sender() {
|
|
for things := range s.send {
|
|
err := websocket.JSON.Send(s.ws, *things)
|
|
if err != nil {
|
|
break
|
|
}
|
|
}
|
|
s.ws.Close()
|
|
log.Printf("Spectator sender close")
|
|
}
|