Alejandro Santillan wrote:

> The output was:
> 8=FIX.4.0.C35=A52=10/26/2006 8:16:10 AM100=PFG10=999
> What is simply correct, but if I put 58 instead of 57, the program hangs
> indefinitely.
> Obviously I don't know the lengh fo the message beforehand.
> 
> Anyone has any idea why this happens and how to avoid it?

Try just reading a max size buffer and taking what you get:

my $buffer;
my $bytes = sysread ($handle, $buffer, 1024);
if (not defined $bytes or $bytes < 0) {
        # err
} elsif ($bytes == 0) {
        # EOF
}
# we now have $bytes worth of data in $buffer.
# process the data and do a select before the next read
# unless blocking is OK
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to