I'm developing networking distributed software in Ansi C and server will receive several "connect" from different kinds of clients which make different kind of requests.
I need to save IP address of clients which make specific requests (according to protocol content) but in accept call I'd like to avoid to collect all IP address of all client request because only some of them will be useful.
I'd like to capture client IP address during recv stage but in this way I know only the socket descriptor, is there way to get ip address client if I know only socket id?
Server can to contact client.