{"action":"closed","issue":{"url":"https://api.github.com/repos/zhuowei/RaspberryJuice/issues/20","labels_url":"https://api.github.com/repos/zhuowei/RaspberryJuice/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/zhuowei/RaspberryJuice/issues/20/comments","events_url":"https://api.github.com/repos/zhuowei/RaspberryJuice/issues/20/events","html_url":"https://github.com/zhuowei/RaspberryJuice/issues/20","id":50273137,"number":20,"title":"RemoteSession.close() doesnt close the socket","user":{"login":"martinohanlon","id":2329501,"avatar_url":"https://avatars.githubusercontent.com/u/2329501?v=3","gravatar_id":"","url":"https://api.github.com/users/martinohanlon","html_url":"https://github.com/martinohanlon","followers_url":"https://api.github.com/users/martinohanlon/followers","following_url":"https://api.github.com/users/martinohanlon/following{/other_user}","gists_url":"https://api.github.com/users/martinohanlon/gists{/gist_id}","starred_url":"https://api.github.com/users/martinohanlon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinohanlon/subscriptions","organizations_url":"https://api.github.com/users/martinohanlon/orgs","repos_url":"https://api.github.com/users/martinohanlon/repos","events_url":"https://api.github.com/users/martinohanlon/events{/privacy}","received_events_url":"https://api.github.com/users/martinohanlon/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/zhuowei/RaspberryJuice/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2014-11-27T09:56:26Z","updated_at":"2015-04-19T19:51:57Z","closed_at":"2015-04-19T19:51:57Z","body":"close() method of RemoteSession should close the socket, at the moment it is closing the outputThread.\r\n\r\ntry {\r\n    out.close();\r\n\r\nShould be\r\n\r\ntry {\r\n    socket.close();\r\n\r\ne.g.\r\n\r\n\tpublic void close() {\r\n\t\tif (closed) return;\r\n\t\trunning = false;\r\n\t\tpendingRemoval = true;\r\n\r\n\t\t//wait for threads to stop\r\n\t\ttry {\r\n\t\t\tinThread.join(2000);\r\n\t\t\toutThread.join(2000);\r\n\t\t}\r\n\t\tcatch (InterruptedException e) {\r\n\t\t\tplugin.getLogger().warning(\"Failed to stop in/out thread\");\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\t//out.close();\r\n\t\t\tsocket.close();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tplugin.getLogger().info(\"Closed connection to\" + socket.getRemoteSocketAddress() + \".\");\r\n\t}"}}