The project that i'm working on is a server. I want the server to display my IP (instead of waiting for my logs to show it). I tried using getsockname(), however, it is to my knowledge that I need to use connect() before calling getsockname() in order to get my ip. Since I use listen() to wait for a client I'm not even sure that I should use a connect() call. Does anyone know what I need to do? Or maybe even a completely different approach to the problem.