dash2 has asked for the wisdom of the Perl Monks concerning the following question:
OK, I am writing to a filehandle which represents a socket. To get unbuffered I/O, as much as possible, I use:
for (my $pointer = 0; $pointer < length($write); $pointer++) { syswrite (WHOIS, $write, 1, $pointer); }
The first time around, this works fine. However, sometimes I need to do this again (I need to recurse to a more specific WHOIS server to get useful WHOIS data, if you must know). So, I call the function again. It appears to work fine (I have checked the return value of syswrite(), and got a suitable number of "1"s) but the raw WHOIS data then appears as if I have only written the first character of $write to the new filehandle.
1) Am I normal? What's going wrong?
2) Is there a way I can check the data that is actually being sent out? Cos maybe their server is just being weird with me. (Update: doesn't seem to happen with other servers than this specific one. But doesn't seem to happen if I only connect once to this specific server.)
dave hj~
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: syswrite strange behaviour on some systems
by AgentM (Curate) on Apr 02, 2001 at 20:46 UTC | |
by dash2 (Hermit) on Apr 02, 2001 at 20:56 UTC | |
by tye (Sage) on Apr 02, 2001 at 23:01 UTC | |
by dash2 (Hermit) on Apr 03, 2001 at 05:01 UTC | |
by tye (Sage) on Apr 03, 2001 at 08:29 UTC |