[Haskell-cafe] TCP Server
Yves Parès
yves.pares at gmail.com
Sat Jan 28 12:40:56 CET 2012
> http://hackage.haskell.org/package/network-server
Straightforward to use, but unfortunately uses "unix" package. I take it it
is not portable.
However its first version did not use it, so maybe the concerned part could
be rewritten.
> I think there is still no consensus on which iteratee library is the one
to use. There are at least iteratee, enumerator, iterIO, conduit, and
> pipes. The reusability of your libary depends on the choice of
iteratee-style library you select.
Yes, and IMO this is a growing problem. Since iteratees were designed, a
lot of different libraries providing this kind of service have appeared.
Of course they all have advantages and inconvenients, but some libraries
that could be compatible are not, because they rely on a different
iteratee-ish package. For instance pipes (as its documentation states) is
really like iteratee... but with more concrete names. Still it's sufficient
to break compatibility.
Or else, we have to make sure that each one (iteratee, enumerator, conduit,
pipes...) has its own set of associated packages and that each provide
equivalent functionalities, but then => combinatorial explosion.
^^ It's just I don't want people to start trolling by applying to Haskell
the adage I've heard quite a few times about Java, stating that "There are
50 ways to achieve something... none of which is good".
2012/1/28 Jean-Marie Gaillourdet <jmg at gaillourdet.net>
> 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.
>
>
> > So I decided to make a library with skeletons for different types of
> > tcp servers and a basic library to make server [3].
> >
> > Now there is only warp based (simplified) tcp server.
> > Main logic is:
> > * handle new connection and start iteratee green thread
> > * enumerator (library side) reads socket and send data into enumeratee
> > (application side)
> > * enumeratee consumes input and produces server command (now simply
> output)
> > and push it into iteratee (server side)
> > * iteratee server side reads command and performs action (now simply
> output
> > command)
> > It gives application possibility to store state in enumerator.
> >
> > My questions to community:
> > 1). can you help to make code better ;) maybe there are some stupid
> mistakes
> > 2). is there any ideas what thing can be add to the server to make it
> reusable
>
> I think there is still no consensus on which iteratee library is the one
> to use. There are at least iteratee, enumerator, iterIO, conduit, and
> pipes. The reusability of your libary depends on the choice of
> iteratee-style library you select.
>
> Jean
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120128/be165752/attachment.htm>
More information about the Haskell-Cafe
mailing list