Comments
Works for STREAM and DGRAM. /* Connect to the server */. if ((sock = socket( AF_INET, SOCK_STREAM, 0)) == -1). {. /* Complain, explain, and exit */ ...
Posted by waqasahmad
SOCK_DGRAM:
- if only sending, no need to bind. The OS finds a port each time the socket sends a pkt
- if receiving, need to bind
Posted by vasunair