Lines Matching defs:serveraddr
35 struct sockaddr_in serveraddr;
39 memset(&serveraddr, 0, sizeof(serveraddr));
40 serveraddr.sin_family = AF_INET;
41 serveraddr.sin_addr.s_addr = htonl(INADDR_ANY);
42 serveraddr.sin_port = 0;
44 bind(sockfd, (struct sockaddr *)&serveraddr, sizeof(serveraddr));
45 socklen_t addrlen = sizeof(serveraddr);
46 getsockname(sockfd, (struct sockaddr *)&serveraddr, &addrlen);
55 msg.msg_name = &serveraddr;
65 ret = connect(sockfd, (struct sockaddr *)&serveraddr, addrlen);
72 sendto(sockfd, buf, kBufSize, 0, (struct sockaddr *)&serveraddr, addrlen);