I have written a simple client server program in C under linux. I have created UDP sockets. The client broadcasts a message using
sendto(clientsock, buf, 100, 0, (struct sockaddr *)&to, sizeof (to));
The server receives the broadcasted message using
recvfrom(serversock, buf, 100, 0, (struct sockaddr *)&rcv,&size);
The message is being successfully received by the server. On the server side, I need to find the source IP address of the message received. How can I do that ?
for a call like –
use