comparison src/ch/ethz/ssh2/Connection.java @ 287:db9b028016de ganymed

start conversion from trilead to ganymed
author Carl Byington <carl@five-ten-sg.com>
date Fri, 18 Jul 2014 19:52:08 -0700
parents 486df527ddc5
children d2ee20d9dff1
comparison
equal deleted inserted replaced
286:4656869af8fe 287:db9b028016de
11 import java.io.IOException; 11 import java.io.IOException;
12 import java.net.InetSocketAddress; 12 import java.net.InetSocketAddress;
13 import java.net.Socket; 13 import java.net.Socket;
14 import java.net.SocketTimeoutException; 14 import java.net.SocketTimeoutException;
15 import java.security.SecureRandom; 15 import java.security.SecureRandom;
16 import java.security.KeyPair;
17 import java.security.PrivateKey;
16 import java.util.ArrayList; 18 import java.util.ArrayList;
17 import java.util.List; 19 import java.util.List;
18 import java.util.Set; 20 import java.util.Set;
19 21
20 import ch.ethz.ssh2.auth.AgentProxy; 22 import ch.ethz.ssh2.auth.AgentProxy;
633 boolean existed = connectionMonitors.remove(cmon); 635 boolean existed = connectionMonitors.remove(cmon);
634 if(tm != null) { 636 if(tm != null) {
635 tm.setConnectionMonitors(connectionMonitors); 637 tm.setConnectionMonitors(connectionMonitors);
636 } 638 }
637 return existed; 639 return existed;
640 }
641
642 /**
643 * Controls whether compression is used on the link or not.
644 * <p>
645 * Note: This can only be called before connect()
646 * @param enabled whether to enable compression
647 * @throws IOException
648 */
649
650 public synchronized void setCompression(boolean enabled) throws IOException {
651 if (tm != null)
652 throw new IOException("Connection to " + hostname + " is already in connected state!");
653
654 if (enabled) enableCompression();
655 else disableCompression();
638 } 656 }
639 657
640 /** 658 /**
641 * Close the connection to the SSH-2 server. All assigned sessions will be 659 * Close the connection to the SSH-2 server. All assigned sessions will be
642 * closed, too. Can be called at any time. Don't forget to call this once 660 * closed, too. Can be called at any time. Don't forget to call this once