
15 Dec
2010
15 Dec
'10
5:37 a.m.
On Wed, Dec 15, 2010 at 12:20 AM, Antoine Latter
Maybe I'm missing something - but shouldn't the code listening on the Handle already be in it's own thread?
The general recipe is:
1. Bind a socket to port 2. Call Network.accept, then take the resultant Handle, call forkIO with the TLS actions and the resultant handle. Go back to 1.
Yes, for 99% of users this is the right thing to do. Note that Haskell
threads are lightweight green threads and that under the hood you are
getting efficient async networking using epoll() or kqueue() on
Linux/OSX.
G
--
Gregory Collins