[Haskell-cafe] Problem making a program in ghc

Adam Langley agl at imperialviolet.org
Thu Mar 13 15:47:15 EDT 2008


2008/3/13 Maverick <maverick_as_2000 at yahoo.es>:
> I have writed an application that parses xml files and returns a result
> (using HaXml), this is published as a service, I implemented a server
> (withSocketsDo), the server listen the port 5760 in a forever fashion, when
> a message arrives, then the program creates a new thread (forkIO) for attend
> the request. This works fine when I run it from ghci, when I make the
> program and run the binary (in Windows), the requests arrive to the program
> but I think that the response can´t be sent because the front end can´t
> receive the response (I am calling the service from a .Net web application),
> I have a log that confirms that the response arrives correctly.

I hate to see any requests for help go unanswered here, but this one
might be tough. I think you need to give some more information,
otherwise the suggestions are going to be very general. Can you put
the Haskell source code on a website somewhere and link to it. Since
it's a network service, an example request and reply might be good to
include.

In general, you should check that you are correctly flushing your
connection. If you are using Handles to interface to the network, they
can buffer the response. hFlush[1] may need to be called when you have
finished generating it.

[1] http://haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#v%3AhFlush

AGL

-- 
Adam Langley agl at imperialviolet.org http://www.imperialviolet.org


More information about the Haskell-Cafe mailing list