I trying to create a messenger(just for practice, so nothing fancy!). I created the server and client programs.
Suppose a client(user A) initiated a connection with the server, so it's online. Now, another user(user B) wants to chat with that user(A). How do I give User B the IP address of User A. I have tried this one,
String ipAddress = connectSocket.getInetAddress().getHostAddress();
this returns me the IP address. But dont User B needs the port number of User A also to connect with that user(A)?
If yes, then how do i do it?
Any advice will help.