2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 03:06:37 +00:00

70_CanOverEthernet: module crashed when UDP port was occupied

git-svn-id: https://svn.fhem.de/fhem/trunk@20429 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
delmar 2019-10-30 21:14:34 +00:00
parent 19a04bbf3e
commit b9963c492d

View File

@ -72,9 +72,11 @@ sub CanOverEthernet_Define($$) {
my $portno = 5441;
my $conn = IO::Socket::INET->new(Proto=>"udp",LocalPort=>$portno);
Log3 $name, 0, "CanOverEthernet ($name) - ERROR: Unable to open port 5441 for reading."
unless defined ($conn);
if ( ! defined $conn ) {
Log3 $name, 0, "CanOverEthernet ($name) - ERROR: Unable to open port 5441 for reading. Maybe it's opened by another process already?";
return undef;
}
$hash->{FD} = $conn->fileno();
$hash->{CD} = $conn;