File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed
src/main/java/org/java_websocket/client Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -140,15 +140,8 @@ public void connect() {
140140 }
141141
142142 public void close () {
143- if ( thread != null ) {
143+ if ( thread != null && conn != null ) {
144144 conn .close ( CloseFrame .NORMAL );
145- /*closelock.lock();
146- try {
147- if( selector != null )
148- selector.wakeup();
149- } finally {
150- closelock.unlock();
151- }*/
152145 }
153146
154147 }
@@ -390,7 +383,7 @@ public final void onWriteDemand( WebSocket conn ) {
390383 key .interestOps ( SelectionKey .OP_READ | SelectionKey .OP_WRITE );
391384 selector .wakeup ();
392385 } catch ( CancelledKeyException e ) {
393- // since such an exception/event will also occur on the selector there is no need to do anything here
386+ // since such an exception/event will also occur on the selector there is no need to do anything herec
394387 }
395388 }
396389
You can’t perform that action at this time.
0 commit comments