Context for the solution helps. So is this a commercial solution, something for school, experimenting, etc. As others have noted there are standard idioms that you can research for doing client/server setups. If you want to roll you own then 1. Separate out communication from processing. Different classes. So you need classes that 'send' a message and classes that 'receive' a message. Then different classes that package a 'desktop image' as a message 2. On the server side when a server accepts a client connection then the server spins up a new thread to handle that request (for messages between the original client and the server.) It does that for each client and perhaps for each message that a unique client sends. A quick glance at your code suggests that you are not creating a new thread for each request.