3 ms·
> IPv4 addresses aren't really 32-bits; they're actually 48 bits: a 32-bit IP-address plus a 16-bit port number. > No! Last time I tried to bind a socket to j
by beaumartinez 16y ago
> IPv4 addresses aren't really 32-bits; they're actually 48 bits: a 32-bit IP-address plus a 16-bit port number.
> No!
Last time I tried to bind a socket to just an IPv4 address I got a compilation error.
- danparsonson 16y agoMaybe so, but the port number is part of TCP, not IP.
- jws 16y agoUse the SOCK_RAW flag on the socket() call and you obviously don't need a bind() call.