- More than one program can listen to the same port on the same IP address, depending on how things are initialised
- Multiple IP's can be listened to for the same port
- TCP and UDP ports are separate, so even without allowing port re-use you can have two processes listen to the same port
And lots more! For me, this was a really engaging way to learn the nuances of how the concepts of processes, ports, protocols, sockets and IP addresses relate to each other. Perhaps the format isn't ideal for everyone. Also, I have probably learned all of these concepts before, so maybe that helps.
Anyway, I bookmarked this for the next time I forget it and need to learn it again :D
edit: formatting
[0] https://www.amazon.com/UNIX-Network-Programming-Richard-Stev...
Maybe it IS that complicated, but I'm wondering if it's worth it for me as a developer that only sometimes touches on these issues, to read through it.
I skimmed that book and it does go quite deep, but also has lots of asides into C programming and Unix in general.
For example, at one point it introduces you to the idea of wrapper functions to simplify error handling. This has nothing to do with socket programming or networking. There's BSD networking history, which might not be worth your time. There's introduction to Unix commands that are outdated if you're on Linux, but "be aware that some vendors place these commands in an administrative directory, such as /sbin". There's a section on Unix standards; would you like to know what POSIX stands for? Would you like to know about 64-bit architectures? Would you like to learn about memset() and memmove(), or fork() and exec()? How about fcntl() and close(), or posix signal handling, or waitpid()? Here let me introduce you to select() and poll() and nonblocking i/o. And pthreads...
It's by no means a bad book but it's about "Unix" and "(C) programming" almost as much as it is about network programming. Depending on your background that may or may not be a bad thing but I prefer materials with narrower focus.
If you really want to understand this it'll be easy enough, connect to irc.libera.chat, join say ##linux or even better #networking and ask any question that comes to mind.
I'd advise anyone to do it; this little story is one of a kind.