
Hi, I have a problem when I am trying to use a binary file generated by ghc make in Windows. Ihave 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 sentbecause the front end can´t receive the response (I am calling theservice from a .Net web application), I have a log that confirms that the response arrives correctly. I use make like this: ghc --make -package HaXml Main.hs HermesService.hs ..... What could be the problem? I am using HaXml 1.13.2 with Ghc 6.6.1, thanks in advance. Alvaro Sejas UMSS Cochabamba - Bolivia ______________________________________________ Enviado desde Correo Yahoo! El buzón de correo sin límite de almacenamiento. http://es.docs.yahoo.com/mail/overview/index.html

2008/3/13 Maverick
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%3AhF... AGL -- Adam Langley agl@imperialviolet.org http://www.imperialviolet.org

This answer may be way off base, but if differences appear between ghci and compiled versions, I've often found its as simple as remembering to compile with the -threaded flag. The ghci runtime is threaded by default, as I understand it, while compiled binaries are not, and IO operations will block in very different fashions (i.e. in their own thread, or stalling the entire app) depending on the runtime. Regards, sterl. On Mar 13, 2008, at 3:47 PM, Adam Langley wrote:
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@imperialviolet.org http://www.imperialviolet.org _______________________________________________ Haskell-Cafe mailing list

Hello Sterling, Friday, March 14, 2008, 7:06:24 AM, you wrote: yes, it's another question. my own program also writes to logfile and it got lock-free only when i've switched to using my own IO routines
This answer may be way off base, but if differences appear between ghci and compiled versions, I've often found its as simple as remembering to compile with the -threaded flag. The ghci runtime is threaded by default, as I understand it, while compiled binaries are not, and IO operations will block in very different fashions (i.e. in their own thread, or stalling the entire app) depending on the runtime.
Regards, sterl.
On Mar 13, 2008, at 3:47 PM, Adam Langley wrote:
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@imperialviolet.org http://www.imperialviolet.org _______________________________________________ Haskell-Cafe mailing list
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com
participants (4)
-
Adam Langley
-
Bulat Ziganshin
-
Maverick
-
Sterling Clover