Meanwhile, On The Server... The server creates a socket that is not connected anywhere. Instead, it binds the socket to its predefined port, and asks the operating system to listen for incoming connections: struct sockaddr_in sa; /* Server's address struct */ /* initiate machine's Internet address structure */ /* first clear out the struct, to avoid garbage */ memset(&sa, 0, sizeof(sa)); /* Using Internet address family */ sa.sin_family = AF_INET; /* copy port number in network byte order */ sa.sin_port = htons(13); /* we will accept connections coming through any IP */ /* address that belongs to our host, using the */ /* INADDR_ANY wild-card. */ sa.sin_addr.s_addr = INADDR_ANY;