¡@

Home 

c++ Programming Glossary: servinfo

Is this a legitimate C++ code? [closed]

http://stackoverflow.com/questions/4372062/is-this-a-legitimate-c-code

sockfd numbytes char buf MAXDATASIZE struct addrinfo hints servinfo p int rv char s INET6_ADDRSTRLEN if argc 2 fprintf stderr usage.. SOCK_STREAM if rv getaddrinfo argv 1 PORT hints servinfo 0 fprintf stderr getaddrinfo s n gai_strerror rv return 1.. all the results and connect to the first we can for p servinfo p NULL p p ai_next if sockfd socket p ai_family p ai_socktype..

Using select() for non-blocking sockets

http://stackoverflow.com/questions/6715736/using-select-for-non-blocking-sockets

sock adrlen new_sd struct addrinfo hints struct addrinfo servinfo will point to the results store the connecting address and size.. AI_PASSIVE use local host address get server info put into servinfo if status getaddrinfo 127.0.0.1 PORT hints servinfo 0 fprintf.. into servinfo if status getaddrinfo 127.0.0.1 PORT hints servinfo 0 fprintf stderr getaddrinfo error s n gai_strerror status exit..