Late reply, but still trying to figure something out here.

What happens if the channel closes?

I'm thinking about maintaining a list of channels (one for each websocket 
client), then sending a message to all of them.  The only problem is that 
when the websocket client disconnects, their channel closes.  Being there 
no easy way to skip closed channels, the program crashes. 

On Thursday, April 7, 2011 at 11:20:37 PM UTC-7, Sunil Nandihalli wrote:
>
> Hello Everybody,
>  I would like to know if there is a way to set up one to many channels.. 
> i.e. Can I have a channel which would broadcast its input on a bunch of 
> channels? The solution I currently use is have a goroutine which listens on 
> this channel and broadcasts it on a collection of channels . If I want to 
> another channel which should be broadcasted on.. then I would add this 
> extra channel to the collection of channels. Is this a good of doing this 
> kind of broadcast? Is there a better way of doing this?
>
> Thanks,
> Sunil.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to