This is my first attempt to write a network client to test my server. So far it looks good except that the amount of writing to STDERR I do during debugging seems to effect how long it takes to read the first buffer of data. The section of code is as follows:
--------Cut Here-------------------------------- #warn "request: ",$request_string; $$self{CONNECTION}->send($request_string); #warn " ( getting the response )"; my ($rebuild, $message, $buffer, $done); $$self{CONNECTION}->recv($buffer,12000); # <----- delay is here #warn "read: ",$buffer; ($message, $buffer, $done) = Sirsi::Utilities::DeChunk($buffer); #warn sprintf ("\n%s|%s|%s",$message, $buffer, $done); until ( $done ) { while ( length ($buffer) ) { ($rebuild, $buffer, $done) = Sirsi::Utilities::DeChunk($buffer); #warn sprintf ("\n%s|%s|%s",$rebuild, $buffer, $done); $message .= $rebuild; } unless ( $done ) { $$self{CONNECTION}->recv($buffer,12000); #warn "read: ",$buffer; ($rebuild, $buffer, $done) = Sirsi::Utilities::DeChunk($buffer); #warn sprintf ("\n%s|%s|%s",$rebuild, $buffer, $done); $message .= $rebuild; } } #warn "\nmessage: ",$message; --------Cut Here-------------------------------- Depending on the 'warn' statements that are un-commented, the 'recv' command may take a second to a minute or two to respond. Sometimes adding a message increases the delay. Sometimes it is shorter. I am testing the code on Active State Perl 5.6.1 running on WinXP. Is there something I should be doing to clear the buffer, or select a file handle, or something to correct this? Tnx, Dgg Darrell Gammill System Support Specialist [EMAIL PROTECTED]
_______________________________________________ Perl-Unix-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs