> telling two loops to run as fast as they can for forever.
The two loops in the example block waiting for input. The loops only consume CPU when a user sends a chat message.Add logging to the loops to determine if they are spinning independent of user input.
> My best guess is that I've altered the example to use
> websocket.JSON.Receive instead of the buffer your example has. I could
> be entirely wrong, though; I'm grasping at straws. Any insight would be
> greatly appreciated.
You're calling,
websocket.JSON.Receive(ws, &data)
but you're not checking for the error value that it returns.
I imagine it's erroring every time it's called so the loop never blocks.
- jessta
Thanks for the help! I really appreciate it. On a side note: is it just me, or are a lot of Go issues caused by not checking for errors?