I have a client server program in C++ console application. I run the server first then run the client. The server should display the ip address from the client that's connected but it says 0.0.0.0
I'm guessing its this line that's causing the problem
getsockname(ListeningSocket, (SOCKADDR *)&ServerAddr, (int *)sizeof(ServerAddr));
printf("Server: Receiving IP(s) from client: %s\n", inet_ntoa(ServerAddr.sin_addr));
in the client i set the ip address to 127.0.0.1
ServerAddr.sin_addr.s_addr = inet_addr("127.0.0.1");