Lines Matching refs:socket
38 #include <sys/socket.h>
85 * @param socket (r) socket, if in blocking mode, pass "setnonblocking" arg as 1
89 * io mode for the socket
94 ssize_t readt(int socket, void *data, const size_t length, int setnonblocking, int timeout)
105 if (setnonblock(socket, 1) != 0)
115 len = read(socket, (char *) data + stored, length - stored);
121 FD_SET(socket, &rfds);
125 while ((ret = select(socket + 1, &rfds, NULL, NULL, &tv)) < 1) {
147 FD_SET(socket, &rfds);
175 if (setnonblock(socket, 0) != 0)
188 * @param socket (r) socket, if in blocking mode, pass "setnonblocking" arg as 1
192 * io mode for the socket
197 ssize_t writet(int socket, void *data, const size_t length, int setnonblocking, int timeout)
206 if (setnonblock(socket, 1) != 0)
216 len = write(socket, (char *) data + stored, length - stored);
223 FD_SET(socket, &rfds);
227 while ((ret = select(socket + 1, &rfds, NULL, NULL, &tv)) < 1) {
248 FD_SET(socket, &rfds);
270 if (setnonblock(socket, 0) != 0)
545 * Receive a fd on a suitable socket
546 * @args fd (r) PF_UNIX socket to receive on
610 * Send a fd across a suitable socket
612 int send_fd(int socket, int fd)
653 ret = sendmsg(socket,&msgh, 0);