I am writing a program which will connect to a remote server, by accepting user name and pwd. This program allows multi-user login also.

If there are multiple users logged in then each of them will receive a message from the remote server.

For this reason I have created a seperate port and a thread for each user. Inside the thread the program will listen on a particular port. The same is with other threads. Now when the data has come for a particular user the aprropriate thread is not getting activated resulting in data loss.

I have tried synchronizing but am not very clear on that concept.

Can you help me resolve this problem.

Regards,
Shivakumar Thota