Does bind actually require conversion to network byte order?
Does bind actually require conversion to network byte order? Problem Description: In every top google result for "C Linux Socket Tutorial" (1, 2, 3, 4, 5 ) they convert the port (and sometimes the address) to network byte order: address.sin_family = AF_INET; address.sin_addr.s_addr = htonl(INADDR_ANY); address.sin_port = htons(PORT); bind(socket_fd, (struct sockaddr*)&address, sizeof(address)); Is this correct? … Read more