Java socket client doesn't detect server messages
问题 I am attempting to run a Java server socket on a remote host which will regularly broadcast messages (determined by external processes) to all connected clients. The server socket is defined as: ServerSocket serverSocket = (ServerSocket) ((ServerSocketFactory)ServerSocketFactory.getDefault()).createServerSocket(3050); while (true) { Socket socket = serverSocket.accept(); remoteService.addSocket(socket); } Which will keep track of the socket connections in an array list. The method below will