Java Server socket stuck on accept call (Android Client, Java Server) <p>Below I have put a fragment of code to help understand my problem. I have a server code, works fine for the first time the client loads and sends a packet. After the first packet is received, the server is stuck on "accept".</p> <p>I have wireshark configured for this port, and the server is getting those packets. I just wonder why accept wont return more than once. Its driving me nuts.</p> <p>Server Code</p> <pre><code> public class DAPool implements Runnable { private ServerSocket serverSocket; private ArrayList&lt;DA&gt; pool; private LinkedList&lt;Socket&gt; clientConnQ; public DAPool(int newPoolSize, int serverPort) { try { serverSocket = new ServerSocket(serverPort, 500, InetAddress.getByName("127.0.0.1")); } catch (IOException e) { e.printStackTrace(); return; } poolSize = newPoolSize; clientConnQ = new LinkedList&lt;Socket&gt;(); pool = new ArrayList&lt;DA&gt;(poolSize); DA deviceThread; for (int threads = 0; threads &lt; poolSize; threads++) { deviceThread = new DA(); connPool.add(deviceThread); deviceThread.start(); } } public void run() { while (true) { Socket incomingSocket; try { incomingSocket = serverSocket.accept(); } catch (IOException e) { e.printStackTrace(); return; } insertNewConnToQ(incomingSocket); } } private class DA extends Thread { private Socket clientSocket; private ObjectInputStream inputObjectStream; public DA() { } public void run() { while (true) { while (clientConnQ.isEmpty()) { synchronized (clientConnQ) { try { clientConnQ.wait(); } catch (InterruptedException ignored) { ignored.printStackTrace(); } } } synchronized (clientConnQ) { clientSocket = (Socket) clientConnQ.removeFirst(); try { inputObjectStream = new ObjectInputStream(clientSocket.getInputStream()); } catch (IOException e) { e.printStackTrace(); return; } // Do something useful here } } } } } </code></pre> <p>Client Code</p> <pre><code>public class SendQueue extends Thread { LinkedList&lt;Message&gt; requestQ; Message sendRequest, requestMessage; Socket clientSocket; OutputStream outputStream; ObjectOutputStream objectOutputStream; public SendQueue(Socket newClientSocket) { requestQ = new LinkedList&lt;Message&gt;(); clientSocket = newClientSocket; } public void run() { while (true) { synchronized (requestQ) { while (requestQ.isEmpty()) { try { requestQ.wait(); } catch (InterruptedException ignored) { ignored.printStackTrace(); } } sendRequest = requestQ.removeFirst(); } try { outputStream = clientSocket.getOutputStream(); objectOutputStream = new ObjectOutputStream(outputStream); objectOutputStream.writeObject(sendRequest); objectOutputStream.flush(); outputStream.flush(); } catch (IOException e) { e.printStackTrace(); } catch (RuntimeException e) { e.printStackTrace(); } } } public int sendRequest(Message message) { synchronized (requestQ) { requestQ.addLast(message); requestQ.notify(); } return 0; } } </code></pre>