I did many and I now work on server systems full time. I have communications programs, file transfer programs all sorts.

I would setup a main server that is connected to all clients to establish if they are online or not. Use the database to access there accounts etc. The main server approach means you send the ip address to a connecting client and remove the bandwidth of all the messages by telling the clients to direct connect. It may seem strange but having a main server app allows IP's to change on clients without haveing to transmit all data through the fixed IP server