Not completely sure this is what you mean, but you can specify a struct to the
accept[
^] call (you use this to accept connection requests from clients) that is filled with the client's IP and port. Google for "accept socket" for more information and possible examples.