Lines Matching defs:sock
188 int sock = 0;
216 sock = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
217 if (sock < 0)
219 sockopt_reuseaddr (sock);
220 sockopt_reuseport (sock);
221 ret = connect (sock, res->ai_addr, res->ai_addrlen);
224 close(sock);
225 sock = -1;
231 if (sock < 0)
234 sock = socket (AF_INET, SOCK_STREAM, 0);
235 if (sock < 0)
255 sockopt_reuseaddr (sock);
256 sockopt_reuseport (sock);
258 ret = connect (sock, (struct sockaddr *) &serv, sizeof (struct sockaddr_in));
261 close (sock);
267 return sock;
893 int sock;
899 sock = THREAD_FD (t);
906 len = recv (sock, buf, SMUXMAXPKTSIZE, 0);
911 close (sock);
919 zlog_warn ("SMUX connection closed: %d", sock);
920 close (sock);
934 close (sock);
941 smux_event (SMUX_READ, sock);
947 smux_open (int sock)
996 return send (sock, buf, (ptr - buf), 0);
1105 smux_register (int sock)
1154 ret = send (sock, buf, (ptr - buf), 0);
1232 smux_event (enum smux_event event, int sock)
1243 smux_read_thread = thread_add_read (master, smux_read, NULL, sock);