my $conn = IO::Socket::INET->new(PeerAddr => $host, PeerPort => $port,Proto => 'tcp'); die unless ($conn); syswrite($conn, "message content"); doSomeOtherStuff(); #by now, under normal conditions, message should have reached the peer and be acknowledged my $pendingMessages = send_q($conn); #this is the function I am looking for but have not found yet if ($pendingMessages) { #perform some recovery actions here. Stop sending messages, until all previous messages have been acknowledged }