Lines Matching defs:sock
145 bgp_bind_address (int sock, struct in_addr *addr)
157 ret = bind (sock, (struct sockaddr *)&local, sizeof (struct sockaddr_in));
276 int sock = 0;
301 sock = socket (ainfo->ai_family, ainfo->ai_socktype, ainfo->ai_protocol);
302 if (sock < 0)
308 sockopt_reuseaddr (sock);
309 sockopt_reuseport (sock);
311 ret = bind (sock, ainfo->ai_addr, ainfo->ai_addrlen);
315 close (sock);
318 ret = listen (sock, 3);
322 close (sock);
326 thread_add_read (master, bgp_accept, bgp, sock);
332 return sock;
339 int sock;
344 sock = socket (AF_INET, SOCK_STREAM, 0);
345 if (sock < 0)
348 return sock;
351 sockopt_reuseaddr (sock);
352 sockopt_reuseport (sock);
363 ret = bind (sock, (struct sockaddr *) &sin, socklen);
367 close (sock);
370 ret = listen (sock, 3);
374 close (sock);
378 thread_add_read (bm->master, bgp_accept, bgp, sock);
380 return sock;