writeSelector = Selector.open();
readSelector = Selector.open();
} catch (IOException e) {
- throw new Exception(e.toString());
+ throw new Exception(e.getMessage());
}
try {
channel.register(writeSelector, SelectionKey.OP_WRITE);
channel.register(readSelector, SelectionKey.OP_READ);
} catch (java.nio.channels.ClosedChannelException e) {
- throw new Exception(e.toString());
+ throw new Exception(e.getMessage());
}
}
channel.socket().shutdownInput();
channel.socket().shutdownOutput();
} catch(IOException e) {
- throw new IOException(e.toString());
+ throw new IOException(e.getMessage());
}
}
try {
channel.close();
} catch(IOException e) {
- throw new IOException(e.toString());
+ throw new IOException(e.getMessage());
}
}
try {
n = channel.read(b);
} catch (java.io.IOException e) {
- throw new Exception(e.toString());
+ throw new Exception(e.getMessage());
}
if (n <= 0)
return (n == 0) ? -1 : 0;
try {
n = channel.write(b);
} catch (java.io.IOException e) {
- throw new Exception(e.toString());
+ throw new Exception(e.getMessage());
}
b.clear();
return n;
}
}
} catch (java.io.IOException e) {
- throw new Exception(e.toString());
+ throw new Exception(e.getMessage());
}
return n;
}
try {
n = channel.write(buf);
} catch (java.io.IOException e) {
- throw new Exception(e.toString());
+ throw new Exception(e.getMessage());
}
return n;
}
try {
n = channel.write(buf, offset, length);
} catch (java.io.IOException e) {
- throw new Exception(e.toString());
+ throw new Exception(e.getMessage());
}
return n;
}
try {
n = channel.read(buf);
} catch (java.io.IOException e) {
- throw new Exception(e.toString());
+ throw new Exception(e.getMessage());
}
return n;
}
try {
n = channel.read(buf, offset, length);
} catch (java.io.IOException e) {
- throw new Exception(e.toString());
+ throw new Exception(e.getMessage());
}
return n;
}
writeSelector = Selector.open();
readSelector = Selector.open();
} catch (java.io.IOException e) {
- throw new Exception(e.toString());
+ throw new Exception(e.getMessage());
}
try {
channel.register(writeSelector, SelectionKey.OP_WRITE);
addr = InetAddress.getByName("0.0.0.0");
}
} catch (UnknownHostException e) {
- throw new Exception(e.toString());
+ throw new Exception(e.getMessage());
}
try {
try {
new_sock.socket().setTcpNoDelay(true);
} catch (java.net.SocketException e) {
- throw new SocketException(e.toString());
+ throw new SocketException(e.getMessage());
}
// Create the socket object & check connection is allowed
try {
fd = new SocketDescriptor();
} catch (java.lang.Exception e) {
- throw new SocketException(e.toString());
+ throw new SocketException(e.getMessage());
}
fd.setChannel(new_sock);
TcpSocket s = new TcpSocket(fd);
try {
((SocketDescriptor)getFd()).close();
} catch (IOException e) {
- throw new Exception(e.toString());
+ throw new Exception(e.getMessage());
}
}
SocketAddress myaddr = ((SocketDescriptor)getFd()).getLocalAddress();
return myaddr.equals(peeraddr);
} catch (IOException e) {
- throw new Exception(e.toString());
+ throw new Exception(e.getMessage());
}
}
try {
((SocketDescriptor)getFd()).shutdown();
} catch (IOException e) {
- throw new Exception(e.toString());
+ throw new Exception(e.getMessage());
}
}
n = fd.select(SelectionKey.OP_WRITE, tv);
} catch (java.lang.Exception e) {
System.out.println(e.toString());
- throw new Exception(e.toString());
+ throw new Exception(e.getMessage());
}
} while (n < 0);
try {
n = fd.write(data, dataPtr, length);
} catch (java.lang.Exception e) {
- throw new Exception(e.toString());
+ throw new Exception(e.getMessage());
}
return n;
try {
n = manager.write(data, dataPtr, length);
} catch (java.io.IOException e) {
- throw new Exception(e.toString());
+ throw new Exception(e.getMessage());
}
//if (n == GNUTLS_E_INTERRUPTED || n == GNUTLS_E_AGAIN)
// return 0;
try {
sock = new TcpSocket(serverHost, serverPort);
} catch (java.lang.Exception e) {
- throw new Exception(e.toString());
+ throw new Exception(e.getMessage());
}
vlog.info("connected to host "+serverHost+" port "+serverPort);
}
wait(1);
}
} catch (java.lang.InterruptedException e) {
- throw new Exception(e.toString());
+ throw new Exception(e.getMessage());
}
}
vlog.info("Redirected to "+host+":"+port);
VncViewer.newViewer(viewer, sock, true);
} catch (java.lang.Exception e) {
- throw new Exception(e.toString());
+ throw new Exception(e.getMessage());
}
}
if (sock != null)
sock.shutdown();
} catch (java.lang.Exception e) {
- throw new Exception(e.toString());
+ throw new Exception(e.getMessage());
}
}
while (!cc.shuttingDown)
cc.processMsg();
} catch (java.lang.Exception e) {
- if (cc == null || !cc.shuttingDown) {
+ if (e instanceof EndOfStream) {
+ vlog.info(e.getMessage());
+ } else if (cc == null || !cc.shuttingDown) {
e.printStackTrace();
- JOptionPane.showMessageDialog(null,
- e.toString(),
- "VNC Viewer : Error",
- JOptionPane.ERROR_MESSAGE);
+ JOptionPane op =
+ new JOptionPane(e.getMessage(), JOptionPane.WARNING_MESSAGE);
+ JDialog dlg = op.createDialog("TigerVNC Viewer");
+ ClassLoader cl = this.getClass().getClassLoader();
+ ImageIcon icon =
+ new ImageIcon(cl.getResource("com/tigervnc/vncviewer/tigervnc.ico"));
+ dlg.setIconImage(icon.getImage());
+ dlg.setVisible(true);
} else {
if (!cc.shuttingDown)
vlog.info(e.toString());