)
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
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
:), 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
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
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:
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
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
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