Quote:Original post by rmsimpson
Quote:Original post by hplus0603 You can't bind() a UDP socket. |
Not sure how it works in *nix world, but in Windows world you CAN and SHOULD bind() a UDP socket before using it. |
In the linux world, you CAN and MAY bind() a UDP socket before using it. sendto()/sendmsg() work independantly of binding. As for recieving:
Quote:From panda@industry:~$ man 7 udp :
... In order to receive packets the socket can be bound to an local address first by using bind(2). Otherwise the socket layer will automatically assign a free local port out of the range defined by net.ipv4.ip_local_port_range and bind the socket to INADDR_ANY.
|
Of course, manually binding will make it easier to port *nix socket code to WS2, if indeed it works as you say it does (which I have no reason to doubt ^_^).