Skip to content
Closed
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: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ build
*.svn
*~
target
.idea
*.ipr
*.iml
*.iws
Expand Down
11 changes: 4 additions & 7 deletions src/main/java/org/java_websocket/server/WebSocketServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public abstract class WebSocketServer extends WebSocketAdapter implements Runnab

private volatile AtomicBoolean isclosed = new AtomicBoolean( false );

private List<WebSocketWorker> decoders;
protected List<WebSocketWorker> decoders;

private List<WebSocketImpl> iqueue;
private BlockingQueue<ByteBuffer> buffers;
Expand Down Expand Up @@ -184,7 +184,7 @@ public WebSocketServer( InetSocketAddress address , int decodercount , List<Draf
public void start() {
if( selectorthread != null )
throw new IllegalStateException( getClass().getName() + " can only be started once." );
new Thread( this ).start();;
new Thread( this ).start();
}

/**
Expand Down Expand Up @@ -219,9 +219,6 @@ public void stop( int timeout ) throws InterruptedException {

synchronized ( this ) {
if( selectorthread != null ) {
if( Thread.currentThread() != selectorthread ) {

}
if( selectorthread != Thread.currentThread() ) {
if( socketsToClose.size() > 0 )
selectorthread.join( timeout );// isclosed will tell the selectorthread to go down after the last connection was closed
Expand Down Expand Up @@ -422,7 +419,7 @@ public ByteBuffer createBuffer() {
return ByteBuffer.allocate( WebSocketImpl.RCVBUF );
}

private void queue( WebSocketImpl ws ) throws InterruptedException {
protected void queue( WebSocketImpl ws ) throws InterruptedException {
if( ws.workerThread == null ) {
ws.workerThread = decoders.get( queueinvokes % decoders.size() );
queueinvokes++;
Expand Down Expand Up @@ -568,7 +565,7 @@ protected boolean addConnection( WebSocket ws ) {
* may be null if the error does not belong to a single connection
*/
@Override
public final void onWebsocketError( WebSocket conn, Exception ex ) {
public void onWebsocketError( WebSocket conn, Exception ex ) {
onError( conn, ex );
}

Expand Down