in reply to Re^2: how to set socket recv timeout in architecture independent manner?
in thread how to set socket recv timeout in architecture independent manner?

I don't need to do recv as I can read through sysread
I'm a bit surprised. A few posts ago, you're wondering how to pass the number 10 in a platform independent way, and now you want to use sysread instead of recv to read from a socket.

Are you sure that works on all platforms?

Replies are listed 'Best First'.
Re^4: how to set socket recv timeout in architecture independent manner?
by saurabh.hirani (Beadle) on May 06, 2009 at 06:18 UTC
    Are you sure that works on all platforms?

    I don't know. I tried looking it up but could not find any pointers on it being architecture dependent. But to be sure, I can use a non blocking recv() instead of sysread() because the only time I would get to do the read operation (be it through recv() or sysread()) would be when select has given me something to read. That way my recv() wouldn't block. Is sysread architecture dependent?

    And while I was looking through the monastery I found this interesting post about sysread - sysread and syswrite in tcp sockets - which says sysread attempts to read the no. of bytes it was told to.

    Update: Read the recv function from perldoc - it exhibits similar behaviour - it too attempts to read the no. of bytes it was told to.