Make network system calls more robust + move constant to another file
Using MSG_NOSIGNAL flag, SIGPIPE error are ignored on Posix-like systems: https://www.man7.org/linux/man-pages/man2/send.2.html
Note: this flag doesn't seem to exist on Windows: https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-send