Hello NetWallah,
Thank you for your time and effort, reading and replying to my question.
After some experimentation I finally understood that PeerAddr on the server side has to combined with the LocalPort, because is the server port locally and it will use this port for communication with the clients.
The only part that I still can not understand is on the server side, it dose not really matters what king of modification I am applying on the LocalAddr => 'localhost', or LocalAddr => "0.0.0.0", still can not communicate locally. I was under the impression that local communication is different than external.
Last question just in case you know about it. I found on IO::Socket::INET the following part of code:
$sock = IO::Socket::INET->new(
PeerPort => 9999,
PeerAddr => inet_ntoa(INADDR_BROADCAST),
Proto => udp,
LocalAddr => 'localhost',
Broadcast => 1 )
or die "Can't bind : $@\n";
I was trying to understand the use of PeerAddr => inet_ntoa(INADDR_BROADCAST),. I was looking online and I found 8.2 The IP address INADDR_BROADCAST where it explains:
If there is a socket that is bound to the address assigned to the interface from which the packet was received, the packet will be delivered to this socket.
I was under the impression that if there is a socket available on the server side, then it can be used for communication but so far I did not found a way to use it. But maybe I did not understand correctly.
Any way thank you again for your time and effort.
Seeking for Perl wisdom...on the process of learning...not there...yet!
|