public synchronized void close() {
        if( !isRunning ) {
            return;
        }
        
        // Gracefully let any connections know that the server is
        // going down.  Without this, their connections will simply
        // error out.
        for( HostedConnection conn : server.getConnections() ) {
            conn.close("Server is shutting down.");
        }
        try {
            Thread.sleep(1000); // wait a couple beats to let the messages go out
        } catch( InterruptedException e ) {
            e.printStackTrace();
        }
        
        server.close();        
        isRunning = false;
        notifyAll();
    }
A simple test chat server.  When SM implements a set
 of standard chat classes this can become a lot simpler.

 @version   $Revision$
 @author    Paul Speed
jme3-examples/src/main/java/jme3test/network/TestChatServer.java