I'm writing a simple udp server application and i ran into an error when i try to get the address of the remote connecting user.
while(run == 1) {
struct sockaddr_in client_addr;
char message[1024];
int len = recvfrom(sockfd, message, 1024, 0, (struct sockaddr*)&client_addr, sizeof client_addr);
printf("Received request from: %s#%d\n", inet_ntoa(client_addr.sin_addr), ntohs(client_addr.sin_port));
}
It always return the remote address: 0.0.0.0#0