in reply to IO::Socket recv and send
Hello milanpwc,
Welcome to the Monastery. This question has been asked and answered before with different approaches (see here How to find out whether socket is still connected?).
Another possible way independent the protocol (UDP / TCP) is the module IO::Socket::INET which has the connected method that you can use before sending the data. For example:
while ( 1 ) { unless ($sock->connected) { $sock->connect($port, $ip) or die $!; } # ... }
Hope this helps, BR.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: IO::Socket recv and send
by milanpwc (Novice) on Mar 26, 2019 at 04:30 UTC | |
by roboticus (Chancellor) on Mar 26, 2019 at 12:34 UTC |