Sorry.  I should have included the opening of the connection:

    $$attributes{CONNECTION} = IO::Socket::INET->new(
                    Proto     => "tcp",
                                        PeerAddr  => $host,
                                        PeerPort  => $port)
         or return undef;
    $$attributes{CONNECTION}->autoflush(1); # so output gets there right
away

I would have thought that the autoflush command would have taken care of
that.

Tnx, Dgg

-----Original Message-----
From: Anderson, Mark (Service Delivery)
[mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 13, 2004 4:23 AM
To: Darrell Gammill; [EMAIL PROTECTED];
[EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: Blocking While Reading the Network


Try 
$|=1;

See "perldoc perlvar"


Kind regards,

Mark Anderson
SMS Deployment
The Royal Bank of Scotland
113 Dundas Street, Edinburgh, EH3 5DE
http://www.manufacturing.rbs.co.uk/GTrswi/


> -----Original Message-----
> From: Darrell Gammill [SMTP:[EMAIL PROTECTED]
> Sent: Tuesday, April 13, 2004 10:12 AM
> To:   [EMAIL PROTECTED];
> [EMAIL PROTECTED];
> [EMAIL PROTECTED]
> Subject:      Blocking While Reading the Network
> 
> *** WARNING : This message originates from the Internet ***
> 
> 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]
> 
>  << File: ATT1140464.txt >> 


The Royal Bank of Scotland plc, Registered in Scotland No. 90312.
Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB

The Royal Bank of Scotland plc is authorised and regulated by the
Financial Services Authority and represents The Royal Bank of Scotland
Marketing Group. The Bank sells life policies, collective investment
schemes and pension products and advises only on the Marketing Group's
range of these products and on a With-Profit Bond produced by Norwich
Union Life (RBS) Limited.

This e-mail message is confidential and for use by the addressee only.
If the message is received by anyone other than the addressee, please
return the message to the sender by replying to it and then delete the
message from your computer. Internet e-mails are not necessarily secure.
The Royal Bank of Scotland plc does not accept responsibility for
changes made to this message after it was sent.

Whilst all reasonable care has been taken to avoid the transmission of
viruses, it is the responsibility of the recipient to ensure that the
onward transmission, opening or use of this message and any attachments
will not adversely affect its systems or data. No responsibility is
accepted by The Royal Bank of Scotland plc in this regard and the
recipient should carry out such virus and other checks as it considers
appropriate.


_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to