5cf86ef7ff
DesktopConnection implements Closeable, so it is implicitly closed after its try-with-resources block. Closing the DesktopConnection shutdowns the sockets, so it is necessary in particular to wake up blocking read() calls from the controller. But the controller thread was joined before the DesktopConnection was closed, causing a deadlock. To fix the problem, join the controller thread only after the DesktopConnection is closed. Refs 400a1c69b198103feff9682895529529890c1acc