Home Segments Index Top Previous Next

728: Mainline

Once socket_number is assigned a value, a call to bind associates the corresponding socket with information held in server_addr.

bind (socket_number, 
      (struct sockaddr *) &server_addr, 
      sizeof (server_addr)); 

Evidently, the call to bind requires a pointer to the server_addr structure that has been cast to a pointer of type sockaddr. Do not concern yourself with why the casting is needed—consider that detail to be an obscure part of the ritual.