[Haskell-cafe] TCP Server

Alexander V Vershilov alexander.vershilov at gmail.com
Sun Jan 29 18:07:32 CET 2012


-- Resending reply to maillistmail

Sat, Jan 28, 2012 at 11:51:32AM +0100, Jean-Marie Gaillourdet wrote
> Hello,
> On 27.01.2012, at 00:47, Alexander V Vershilov wrote:
> > Recently I asked about tcp server libraries [1] and there was only one
> > answer haskell-scallable-server [2], but in that package there was some
> > dependencies and server logic that are not good for my task.
> A simple search for "server" on Hackage turned up the following packages for 
> somewhat generic server infrastructure:
> http://hackage.haskell.org/package/iterio-server
> http://hackage.haskell.org/package/generic-server
> http://hackage.haskell.org/package/c10k
> http://hackage.haskell.org/package/network-server
> In issue 19 of The Monad Reader is an article discussing the design of the 
> following web server:
> http://hackage.haskell.org/package/mighttpd2
> This links might be relevant to your original question.

Thanks I've checked code as sow interesting solutions, maybe I'll ask some more
questions about desicions.

As I see all servers uses accept-forkIO i.e. one green-thread to accept sockets
and then runs another thread for each connection, in this thread function from
ServerOptions is run, that function read Socket/Handle itself.
Also I've seen another way of implemeting server 
in this solution author also uses accept-forkIO style to create workers, but
main thread is used for all socket IO, i.e. accepting, reading and writing data
back, this server uses STM channels to send data between threads, as I see this
is orthogonal way of dealing with server. I'm interested if there is some more
ways that are more affectfull in some cases that accept-forkIO(socketIO) or

> Jean

Alexander V Vershilov
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120129/448d1844/attachment.pgp>

More information about the Haskell-Cafe mailing list