Im trying to setup a port listening program using c++ with socket.
If I configure my address like this,
inputing my computers ip staticlly I get my server to work. If I however try to use the loop-back address (127.0.0.1) it doesnt work. How can I setup my program to use the computers current ip address ?Code:sockaddr_in host; host.sin_family = AF_INET; host.sin_port = htons(portnr); host.sin_addr.S_un.S_addr = inet_addr("10.0.0.10"); memset(&(host.sin_zero), '\0', 8);
Thanks for any help.