Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/main/java/org/java_websocket/SSLSocketChannel2.java
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,6 @@ public void close() throws IOException {
if( socketChannel.isOpen() )
socketChannel.write( wrap( emptybuffer ) );// FIXME what if not all bytes can be written
socketChannel.close();
exec.shutdownNow();
}

private boolean isHandShakeComplete() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,8 @@ public WebSocketImpl createWebSocket( WebSocketAdapter a, Draft d, Socket c ) {
public WebSocketImpl createWebSocket( WebSocketAdapter a, List<Draft> d, Socket s ) {
return new WebSocketImpl( a, d );
}
@Override
public void close() {
exec.shutdown();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@ public WebSocketImpl createWebSocket( WebSocketAdapter a, List<Draft> d, Socket
public SocketChannel wrapChannel( SocketChannel channel, SelectionKey key ) {
return (SocketChannel) channel;
}
@Override
public void close() {
}
}
4 changes: 4 additions & 0 deletions src/main/java/org/java_websocket/server/WebSocketServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ public void stop( int timeout ) throws InterruptedException {
ws.close( CloseFrame.GOING_AWAY );
}

wsf.close();

synchronized ( this ) {
if( selectorthread != null && selectorthread != Thread.currentThread() ) {
selector.wakeup();
Expand Down Expand Up @@ -729,5 +731,7 @@ public interface WebSocketServerFactory extends WebSocketFactory {
* @return The channel on which the read and write operations will be performed.<br>
*/
public ByteChannel wrapChannel( SocketChannel channel, SelectionKey key ) throws IOException;

public void close();
}
}