src/main/java/org/java_websocket/server/WebSocketServer.java
private boolean doEnsureSingleThread() {
		synchronized ( this ) {
			if( selectorthread != null )
				throw new IllegalStateException( getClass().getName() + " can only be started once." );
			selectorthread = Thread.currentThread();
			if( isclosed.get() ) {
				return false;
			}
		}
		return true;
	}
private boolean doEnsureSingleThread() {
		synchronized ( this ) {
			if( selectorthread != null )
				throw new IllegalStateException( getClass().getName() + " can only be started once." );
			selectorthread = Thread.currentThread();
			if( isclosed.get() ) {
				return false;
			}
		}
		return true;
	}
private boolean doEnsureSingleThread ( ) { synchronized ( this ) { if ( selectorthread != null ) throw new IllegalStateException ( getClass ( ) . getName ( ) + " can only be started once." ) ; selectorthread = Thread . currentThread ( ) ; if ( isclosed . get ( ) ) { return false ; } } return true ; }
The websocket server can only be started once
@return true, if the server can be started, false if already a thread is running
The websocket server can only be started once