in reply to Multiplexing in client

Yes. This will send/receive messages continuously, to each of two echo servers concurrently:

#! perl -slw use strict; use threads; use IO::Socket; my $t1 = async { my $s = IO::Socket::INET->new( 'localhost:12345' ); for ( 1 .. 1e6 ) { printf $s "Message %6d\n", $_; printf 'Sent and received: %s', scalar <$s>; sleep 1; } }; my $t2 = async { my $s = IO::Socket::INET->new( 'localhost:54321' ); for ( 1 .. 1e6 ) { printf $s "Message %6d\n", $_; printf 'Sent and received: %s', scalar <$s>; sleep 1; } }; $_->join for $t1, $t2;

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP an inspiration; A true Folk's Guy