zhuowei/RaspberryJuice

RemoteSession.close() doesnt close the socket

Closed this issue · 1 comments

close() method of RemoteSession should close the socket, at the moment it is closing the outputThread.

try {
out.close();

Should be

try {
socket.close();

e.g.

public void close() {
    if (closed) return;
    running = false;
    pendingRemoval = true;

    //wait for threads to stop
    try {
        inThread.join(2000);
        outThread.join(2000);
    }
    catch (InterruptedException e) {
        plugin.getLogger().warning("Failed to stop in/out thread");
        e.printStackTrace();
    }

    try {
        //out.close();
        socket.close();
    } catch (Exception e) {
        e.printStackTrace();
    }
    plugin.getLogger().info("Closed connection to" + socket.getRemoteSocketAddress() + ".");
}

Fixed in version 1.7