mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-11 15:37:41 +00:00
GUAC-906: Implement GuacamoleConnectionClosedException. Throw when read/write fails due to closure.
This commit is contained in:
@@ -25,9 +25,11 @@ package org.glyptodon.guacamole.io;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
import java.net.SocketException;
|
||||
import java.net.SocketTimeoutException;
|
||||
import java.util.Deque;
|
||||
import java.util.LinkedList;
|
||||
import org.glyptodon.guacamole.GuacamoleConnectionClosedException;
|
||||
import org.glyptodon.guacamole.GuacamoleException;
|
||||
import org.glyptodon.guacamole.GuacamoleServerException;
|
||||
import org.glyptodon.guacamole.GuacamoleUpstreamTimeoutException;
|
||||
@@ -182,6 +184,9 @@ public class ReaderGuacamoleReader implements GuacamoleReader {
|
||||
catch (SocketTimeoutException e) {
|
||||
throw new GuacamoleUpstreamTimeoutException("Connection to guacd timed out.", e);
|
||||
}
|
||||
catch (SocketException e) {
|
||||
throw new GuacamoleConnectionClosedException("Connection to guacd is closed.", e);
|
||||
}
|
||||
catch (IOException e) {
|
||||
throw new GuacamoleServerException(e);
|
||||
}
|
||||
|
@@ -25,8 +25,12 @@ package org.glyptodon.guacamole.io;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Writer;
|
||||
import java.net.SocketException;
|
||||
import java.net.SocketTimeoutException;
|
||||
import org.glyptodon.guacamole.GuacamoleConnectionClosedException;
|
||||
import org.glyptodon.guacamole.GuacamoleException;
|
||||
import org.glyptodon.guacamole.GuacamoleServerException;
|
||||
import org.glyptodon.guacamole.GuacamoleUpstreamTimeoutException;
|
||||
import org.glyptodon.guacamole.protocol.GuacamoleInstruction;
|
||||
|
||||
/**
|
||||
@@ -58,6 +62,12 @@ public class WriterGuacamoleWriter implements GuacamoleWriter {
|
||||
output.write(chunk, off, len);
|
||||
output.flush();
|
||||
}
|
||||
catch (SocketTimeoutException e) {
|
||||
throw new GuacamoleUpstreamTimeoutException("Connection to guacd timed out.", e);
|
||||
}
|
||||
catch (SocketException e) {
|
||||
throw new GuacamoleConnectionClosedException("Connection to guacd is closed.", e);
|
||||
}
|
||||
catch (IOException e) {
|
||||
throw new GuacamoleServerException(e);
|
||||
}
|
||||
|
Reference in New Issue
Block a user