[Haskell-cafe] TCP Server

Alexander V Vershilov alexander.vershilov at gmail.com
Fri Jan 27 00:47:02 CET 2012


Hello, café.

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.

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

And another thing that I want to add other types of server e.g. single threaded,
with workers pool, or other types. And I want to ask what types of servers
will be effective in haskell.



[1] http://www.haskell.org/pipermail/haskell-cafe/2012-January/098594.html
[2] https://github.com/jamwt/haskell-scalable-server
[3] https://github.com/qnikst/TcpServers

--
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/20120126/9d7cde71/attachment.pgp>


More information about the Haskell-Cafe mailing list