[Haskell-cafe] Network.Socket Woes

2008-03-07 Thread Scott Bell
) I'm able to successfully receive a 64 byte message from my test program. The Haskell version, however, does not return from recvFrom. I've also tried wrapping this in a withSocketsDo, with no effect. How can I proceed to debug/troubleshoot this program? Thanks, - Scott Bell

Re: [Haskell-cafe] Network.Socket Woes

2008-03-07 Thread Scott Bell
Adam, This does the trick, thanks! I certainly would not have been able to track down such an insidious `issue' without much agony and despair. - Scott On Fri, Mar 7, 2008 at 10:48 AM, Adam Langley [EMAIL PROTECTED] wrote: On Fri, Mar 7, 2008 at 8:10 AM, Scott Bell [EMAIL PROTECTED] wrote

[Haskell-cafe] `Expect'-like lazy reading/Parsec matching on TCP sockets

2007-04-03 Thread Scott Bell
:), for example. What's the best approach to take while leveraging laziness if possible? Thanks, - Scott Bell ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] `Expect'-like lazy reading/Parsec matching on TCP sockets

2007-04-04 Thread Scott Bell
Bulat, one possible solution: use Streams library and establish a stream transformer that adds an error call on timeout. something like this: data StreamWithTimeout s = StreamWithTimeout s Timeout instance Stream s = Stream (StreamWithTimeout s) where vGetChar (StreamWithTimeout s t) = do

Re: Re[2]: [Haskell-cafe] `Expect'-like lazy reading/Parsec matching on TCP sockets

2007-04-05 Thread Scott Bell
Bulat, yes, with both variants. actually, second one should be easier to implement and understand. you should look into unsafeInterleaveIO section of http://haskell.org/haskellwiki/IO_inside This seems to do what I want, and unless I'm overlooking something it feels very straight-forward:

[Haskell-cafe] Re: `Expect'-like lazy reading/Parsec matching on TCP sockets

2007-04-06 Thread Scott Bell
Ooops! It seems that this doesn't behave well with a -threaded RTS. I get an EOF on handles that I know for a fact shouldn't be receiving them. It still works well without -threaded, but does anyone know why I'm getting this behavior? hGetContentsTimeout :: Handle - Int - IO String

[Haskell-cafe] Re: `Expect'-like lazy reading/Parsec matching on TCP sockets

2007-04-07 Thread Scott Bell
try with hand-made timeout solution I'm not sure what the status is on hWaitForInput with the snapshot that I am using -- any other ideas what I could try to further isolate the problem? - Scott Bell ___ Haskell-Cafe mailing list Haskell-Cafe

Re: [Haskell-cafe] Re: `Expect'-like lazy reading/Parsec matching on TCP sockets

2007-04-09 Thread Scott Bell
Have you got a complete (but preferably small) program showing the problem? Ian, Here is the source and behavior that I'm seeing (Linux x86, under both 6.6 and 6.7-20070404: module Main where import System.IO import System.IO.Unsafe import System.Process import Text.ParserCombinators.Parsec