Anyone know why I cant seem to use `sendTo` for an off-machine address? Using 
@jrfonden 's example above, if I set the `sendTo` address to `192.168.1.44` 
which is the machine I'm on, it works just fine. (Especially if I'm also 
running the UDP server on my local machine.)

But, if I set the address to `192.168.1.45`, which is the machine sitting next 
to me on the same network, I get a run-time crash as soon as a send a packet:
    
    
    $ ./client2
    Listening to stdin and 127.0.0.1:8800; transmitting to 192.168.1.45:9900
    help
    /home/johnd/Projects/LastManHanging/server/client2.nim(30) client2
    /home/johnd/.choosenim/toolchains/nim-1.4.0/lib/pure/net.nim(1710) sendTo
    /home/johnd/.choosenim/toolchains/nim-1.4.0/lib/pure/net.nim(1699) sendTo
    /home/johnd/.choosenim/toolchains/nim-1.4.0/lib/pure/includes/oserr.nim(94) 
raiseOSError
    Error: unhandled exception: Invalid argument [OSError]
    
    
    Run

The `net.nim` module at line 1699 (nim version 1.4.0) appears to imply it could 
not "lookup" the address. Yet, when I simulate the `getAddrInfo(address, port, 
af, socket.sockType, socket.protocol)` on line 1682 I absolutely get one IPv4 
address back.

In fact _any_ IP address that isn't part of the local network stack does not 
work. Tried it on two machines if different OS: Linux Mint 20 and PopOS; same 
effect.

Is there something unique to c-like `getAddrInfo` call that Nim uses?

I'm kind of stumped.

Reply via email to