Skorche
2004.06.26, 03:05 AM
So I've started dabbling around with Ruby, and it seems like an awesome language.
Upon seeing it's rich and easy socket library, I decided that this might be a good time to learn how to use UDP. Instead of an easy time, I seem to have stumbled onto some really confusing errors...
calling: aSocket.bind('domain name', port) only works if you use the local machine for the domain name. Otherwise it gives an error saying that the name can't be found. Messages sent from the local machine have the ip address 127.0.0.1 when the machine's ip address is really 192.168.1.100. If you use the real ip address for the DN, it doesn't work, but the 127 address works. Calling the send method to a remote machine works, but the same name used in bind gives errors.
Also, IPSocket.getaddress('domain name') is supposed to return the ip address, but instead returns the ipv6 address.
Is there something particularly important point that I'm missing? I can post code if needed.
Upon seeing it's rich and easy socket library, I decided that this might be a good time to learn how to use UDP. Instead of an easy time, I seem to have stumbled onto some really confusing errors...
calling: aSocket.bind('domain name', port) only works if you use the local machine for the domain name. Otherwise it gives an error saying that the name can't be found. Messages sent from the local machine have the ip address 127.0.0.1 when the machine's ip address is really 192.168.1.100. If you use the real ip address for the DN, it doesn't work, but the 127 address works. Calling the send method to a remote machine works, but the same name used in bind gives errors.
Also, IPSocket.getaddress('domain name') is supposed to return the ip address, but instead returns the ipv6 address.
Is there something particularly important point that I'm missing? I can post code if needed.