On Tue, Jun 14, 2016 at 10:15 PM,  <integ...@gmail.com> wrote:
>
> 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.

To be clear, I assume that we are talking about the Go chan type.

Closing a channel is a send operation, and only the sender should
close a channel.  So I'm not sure what you mean when you that when the
websocket client disconnects, their channel closes.  If you are
sending a message to the client, then the client should not close the
channel.

Ian

-- 
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