Lines Matching refs:serveraddr
35 struct sockaddr_in serveraddr; in client_thread_udp() local
36 socklen_t addrlen = sizeof(serveraddr); in client_thread_udp()
38 int succeeded = getsockname(sockfd, (struct sockaddr *)&serveraddr, &addrlen); in client_thread_udp()
41 succeeded = sendto(sockfd, buf, kBufSize, 0, (struct sockaddr *)&serveraddr, in client_thread_udp()
42 sizeof(serveraddr)); in client_thread_udp()
56 struct sockaddr_in serveraddr; in main() local
61 memset(&serveraddr, 0, sizeof(serveraddr)); in main()
62 serveraddr.sin_family = AF_INET; in main()
63 serveraddr.sin_addr.s_addr = htonl(INADDR_ANY); in main()
64 serveraddr.sin_port = 0; in main()
66 int bound = bind(sockfd, (struct sockaddr *)&serveraddr, sizeof(serveraddr)); in main()
70 pthread_create(&client_thread, NULL, client_thread_udp, &serveraddr); in main()