Skip to content

Commit 9418783

Browse files
author
Don Park
committed
ensure variable thread is null at thread exit
1 parent 3b10dcf commit 9418783

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎src/net/tootallnate/websocket/WebSocketClient.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@ private void tryToConnect( InetSocketAddress remote ) throws IOException {
134134
public void run() {
135135
if(thread == null)
136136
thread = Thread.currentThread();
137+
interruptableRun();
138+
thread = null;
139+
}
140+
141+
protected void interruptableRun() {
137142
try {
138143
tryToConnect( new InetSocketAddress( uri.getHost(), getPort() ) );
139144
}

0 commit comments

Comments
 (0)