Lines Matching refs:sock
47 socket_close(int sock) in socket_close() argument
50 close(sock); in socket_close()
60 int sock = socket(AF_INET, type, 0); in socket_loopback_server() local
61 if (sock < 0) { in socket_loopback_server()
71 setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &n, sizeof(n)); in socket_loopback_server()
73 if (TFR(bind(sock, (struct sockaddr*)&addr, sizeof(addr))) < 0) { in socket_loopback_server()
74 socket_close(sock); in socket_loopback_server()
79 if (TFR(listen(sock, 4)) < 0) { in socket_loopback_server()
80 socket_close(sock); in socket_loopback_server()
85 return sock; in socket_loopback_server()
91 int sock, client; in main() local
95 sock = socket_loopback_server( port, SOCK_STREAM ); in main()
96 if (sock < 0) { in main()
102 client = TFR(accept(sock, NULL, NULL)); in main()