Note from the gorilla websocket documentation ' *SetReadDeadline sets the
read deadline on the underlying network connection. After a read has timed
out, the websocket connection state is corrupt and all future reads will
return an error. A zero value for t means reads will not time out.*'
Th
>
> if `ws.Read` returns after a reasonable timeout, you can perform a
> non-blocking receive on the quit channel to see if it has been
> closed/something has been sent to it:
>
> select {
> case <-quit:
> break
> default:
>
Hi,
if `ws.Read` returns after a reasonable timeout, you can perform a
non-blocking receive on the quit channel to see if it has been
closed/something has been sent to it:
select {
case <-quit:
break
default:
I have a function that must be executed as a go routine infinitely until a
message comes in a channel. For example:
func readWebSocket(ws *websocket.socket, quit chan bool) {
for {
out, err = ws.Read()
log.Println(out, err)
}
}
Now I call this above function as a goroutine from ma