I call recvfrom, it's an UDP connection. How to get the IP address from which the packet came, out of the struct now?
Fifth parameter to recvfrom() is a pointer to a sockaddr structure... so, pass a pointer to a sockaddr structure here. The sixth parameter is a pointer to a dword holding the size, so fill out a DWORD with sizeof sockaddr, and pass a pointer to the dword.
Ye I did that so far, but how can I get the IP address out of the struct now? :)
Ok... first, it's smarter to use a sockaddr_in - since there isn't any HLL compiler requiring a typecast ;). Then, you should be able to find the IP in sin.sin_addr.S_addr.