comparison src/ch/ethz/ssh2/Connection.java @ 372:20d0a1356c43

debug kex error
author Carl Byington <carl@five-ten-sg.com>
date Mon, 04 Aug 2014 12:11:12 -0700
parents 071a1ff9b6bf
children 2768eb029d73
comparison
equal deleted inserted replaced
371:071a1ff9b6bf 372:20d0a1356c43
670 * closed, too. Can be called at any time. Don't forget to call this once 670 * closed, too. Can be called at any time. Don't forget to call this once
671 * you don't need a connection anymore - otherwise the receiver thread may 671 * you don't need a connection anymore - otherwise the receiver thread may
672 * run forever. 672 * run forever.
673 */ 673 */
674 674
675 public void close() { 675 public synchronized void close() {
676 log.debug("Connection.close()"); 676 log.debug("Connection.close()");
677 Throwable t = new Throwable("Closed due to user request."); 677 Throwable t = new Throwable("Closed due to user request.");
678 close(t, false); 678 close(t, false);
679 } 679 }
680 680
681 public void close(Throwable t, boolean hard) { 681 public synchronized void close(Throwable t, boolean hard) {
682 log.debug(String.format("Connection.close(%s hard=%b)", t.getMessage(), hard)); 682 log.debug(String.format("Connection.close(%s hard=%b)", t.getMessage(), hard));
683 if (cm != null) { 683 if (cm != null) {
684 cm.closeAllChannels(); 684 cm.closeAllChannels();
685 } 685 }
686 686