Lines Matching refs:socket
33 #include <sys/socket.h>
46 * This program creates a datagram socket, binds a name to it, then reads
47 * from the socket.
55 /* Create socket from which to read. */
56 sock = socket(AF_INET, SOCK_DGRAM, 0);
58 perror("opening datagram socket");
66 perror("binding datagram socket");
72 perror("getting socket name");
75 printf("Socket has port #%d\en", ntohs(name.sin_port));
76 /* Read from the socket */