File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed
src/main/java/org/java_websocket/server Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -216,16 +216,10 @@ public void stop( int timeout ) throws InterruptedException{
216216 }
217217
218218synchronized ( this ){
219- if ( selectorthread != null ){
220- if ( Thread .currentThread () != selectorthread ){
221-
222- }
223- if ( selectorthread != Thread .currentThread () ){
224- if ( socketsToClose .size () > 0 )
225- selectorthread .join ( timeout );// isclosed will tell the selectorthread to go down after the last connection was closed
226- selectorthread .interrupt ();// in case the selectorthread did not terminate in time we send the interrupt
227- selectorthread .join ();
228- }
219+ if ( selectorthread != null && selectorthread != Thread .currentThread () ){
220+ selector .wakeup ();
221+ selectorthread .interrupt ();
222+ selectorthread .join ( timeout );
229223 }
230224 }
231225 }
You can’t perform that action at this time.
0 commit comments