
3 Mar
2012
3 Mar
'12
7:05 a.m.
On Fri, Mar 2, 2012 at 7:34 PM, Joey Adams
I'll try to put together a simple chat server example, like the one I wrote for stm-channelize.
Here it is: https://github.com/joeyadams/haskell-chat-server-example See, in particular, the serveLoop function. When a message is received from the client, it is written to the send channel of every other client. When a message is written on the client's own send channel, it is transmitted to the client. The primary thread for the client waits until one of the worker threads signals completion, then kills both of the worker threads. I hope this example gives you some ideas. -Joey