From the documentation of recv:
Returns the address of the sender if SOCKET's protocol supports this; returns an empty string otherwise. If there's an error, returns the undefined value.
This means the while loop will terminate when the call happens to return a false value. This works for me:
while (1) { defined $sock->recv($data, 1024) or die "recv error: $!"; ...
Update 2019-08-17: Updated the link to "Truth and Falsehood".
In reply to Re: Unix socket domain datagram within local server
by haukex
in thread Unix socket domain datagram within local server
by evergreen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |