From b7a1cdf2cc08f32cb9520d02212f1f0b2066af75 Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Fri, 21 Aug 2015 21:16:20 -0700 Subject: [PATCH] Ensure we aren't waiting for a connection when we've been disconnected by the user. --- src/main/java/org/spacehq/packetlib/tcp/TcpClientSession.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/spacehq/packetlib/tcp/TcpClientSession.java b/src/main/java/org/spacehq/packetlib/tcp/TcpClientSession.java index e11ddfc7..f1cac837 100644 --- a/src/main/java/org/spacehq/packetlib/tcp/TcpClientSession.java +++ b/src/main/java/org/spacehq/packetlib/tcp/TcpClientSession.java @@ -90,7 +90,7 @@ public class TcpClientSession extends TcpSession { ChannelFuture future = bootstrap.connect().sync(); if(future.isSuccess()) { - while(!isConnected()) { + while(!isConnected() && !disconnected) { try { Thread.sleep(5); } catch(InterruptedException e) {