Your post boils down to "Autoflushing doesn't work on socket CLIENT after reading from it." and a bunch of code with no relation to this problem at all.
Anything to back up your claim?
Anything to reproduce that bug?
Any code at all relating to the bug?
Any changechance you're mixing select with read or readline (aka <>)?
Give us a bone!
This is just fine where all my writes to CLIENT via print work as desired i.e. in line buffered mode.
I think you mean "unbuffered" rather than "line buffered". Line buffered is specific to STDOUT attached to a terminal with autoflush false. CLIENT->autoflush(1); doesn't match any of those three criteria.
By the way, your code would be much clearer using IO::Socket::INET.
use Socket qw( AF_INET SOMAXCONN ); use IO::Socket qw( ); my $socket = IO::Socket->new( Domain => AF_INET, Proto => 'tcp', LocalPort => $port, ReuseAddr => 1, Listen => SOMAXCONN, ) or do { $logger->fatal("Can't create socket: $!"); $logger->fatal("Exiting with an exit code of $!."); exit($!); };
In reply to Re: Buffering & Network Programming Reads and Writes!!
by ikegami
in thread Buffering & Network Programming Reads and Writes!!
by MarkovChain
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |