Lines Matching defs:sockfd
52 int sockfd;
82 sockfd = socket(AF_INET, SOCK_DGRAM, 0);
83 RUNTIME_CHECK(sockfd != -1);
115 sent = sendto(sockfd, buf, length, 0,
120 recvfrom(sockfd, buf, 65536, MSG_DONTWAIT, NULL, NULL);
129 close(sockfd);
144 int sockfd;
188 sockfd = socket(AF_INET, SOCK_DGRAM, 0);
189 RUNTIME_CHECK(sockfd != -1);
241 sent = sendto(sockfd, respacket, sizeof(respacket), 0,
268 FD_SET(sockfd, &fds);
271 max = (listenfd > sockfd ? listenfd : sockfd)+1;
276 if (FD_ISSET(sockfd, &fds)) {
278 recvfrom(sockfd, buf, 65536, 0, NULL, NULL);
305 close(sockfd);
323 int sockfd;
393 sockfd = socket(AF_INET, SOCK_STREAM, 0);
395 RUNTIME_CHECK(sockfd != -1);
396 RUNTIME_CHECK(setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR,
400 r = connect(sockfd, (struct sockaddr*)&servaddr,
404 sent = write(sockfd, buf, length);
406 close(sockfd);
409 recvfrom(sockfd, buf, 65537, MSG_DONTWAIT, NULL, NULL);
418 close(sockfd);