Lines Matching refs:sockfd
14 int opensocket(int *sockfd, const char *name, int connecttype) in opensocket() argument
30 *sockfd = ret; in opensocket()
31 if (setsockopt(*sockfd, SOL_SOCKET, SO_REUSEADDR, in opensocket()
51 ret = bind(*sockfd, (struct sockaddr *)&skaddr, in opensocket()
59 ret = listen(*sockfd, 5); in opensocket()
69 ret = accept(*sockfd, (struct sockaddr *)&skaddr, in opensocket()
78 *sockfd = clientfd; in opensocket()
87 ret = connect(*sockfd, (struct sockaddr *)&skaddr, in opensocket()
99 if (*sockfd) in opensocket()
100 close(*sockfd); in opensocket()
105 int sendtosocket(int sockfd, struct socketdata *skdata) in sendtosocket() argument
123 FD_SET(sockfd, &selFDs); in sendtosocket()
127 ret = select(sockfd+1, NULL, &selFDs, NULL, &timeout); in sendtosocket()
134 if (FD_ISSET(sockfd, &selFDs)) { in sendtosocket()
150 ret = sendmsg(sockfd, &msgh, MSG_DONTWAIT); in sendtosocket()
161 int receivefromsocket(int sockfd, struct socketdata *skdata) in receivefromsocket() argument
179 FD_SET(sockfd, &recvFDs); in receivefromsocket()
181 ret = select(sockfd+1, &recvFDs, NULL, NULL, NULL); in receivefromsocket()
188 if (FD_ISSET(sockfd, &recvFDs)) { in receivefromsocket()
202 ret = recvmsg(sockfd, &msgh, MSG_DONTWAIT); in receivefromsocket()
216 int closesocket(int sockfd, char *name) in closesocket() argument
220 if (sockfd) in closesocket()
221 close(sockfd); in closesocket()
224 shutdown(sockfd, 2); in closesocket()