Skip to content
Advertisement

Tag: getaddrinfo

Understanding getaddrinfo function in C

I’m new to C and socket programming, just a question on getaddrinfo function. The function prototype of getaddrinfo is: and getaddrinfo returns a result that points to a linked list of addrinfo structures, each of which points to a socket address structure that corresponds to host and service. Below is my questions: Q1-Why it needs to return a result that

How to select the interface used to perform a hostname lookup

I am working in an application embedded in a device running Linux and BusyBox. The hardware has 2 communication interfaces: Wi-Fi and 3G. In each connection, the application must try to connect using wi-fi first and, if it fails, the application tries again using 3G. I am forcing the connection to use the selected interface binding it like this: But

Advertisement