Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.
struct addrinfo hints, *start, *results; bzero(&hints, sizeof(struct addrinfo)); hints.ai_flags = AI_PASSIVE; // Use address return by getaddrinfo in bind() return addrinfo will have INADDR_ANY set to IPv4 adress and INADDR6_ANY_INIT for IPv6 address hints.ai_family = AF_UNSPEC; // return both the family AF_INET and AF_INET6 address structures hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = IPPROTO_TCP; getaddrinfo(NULL, "4455", &hints, &results); int fd = socket(results->ai_family, results->ai_socktype, results->ai_protocol); bind(fd, results->ai_addr, results->ai_addrlen);
METHOD 1 ---> This prints Addres = 0.0.0.0 // I believe this is because I have AI_PASSIVE set. struct sockaddr_storage addr; len = sizeof (struct sockaddr_storage); getsockname(fd, (struct sockaddr*)&addr, &len ); struct sockaddr_in *sin = (struct sockaddr_in *)&addr; char str[INET_ADDRSTRLEN]; inet_ntop(AF_INET, &sin->sin_addr, str, INET_ADDRSTRLEN); DBG0(" Addres = " << str); METHOD 2: --> This prints Adress =127.0.0.1 In this method, instead of using "fd", I am using the socket descriptor from "accept" call
|Header of docx file||17||97|
|How to copy documents folder to network folder automatically as backup?||15||84|
|extend vlan through a layer 3 connection||31||94|
|Which Protocol is better for IP based Camera traffic in a Network.||2||41|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
21 Experts available now in Live!