@Override
        public void messageReceived(HostedConnection source, Message m) {
            if (m instanceof ChatMessage) {
                // Keep track of the name just in case we 
                // want to know it for some other reason later, and it's
                // a good example of session data.
                ChatMessage cm = (ChatMessage)m;
                source.setAttribute("name", cm.getName());

                // Check for a / command
                if( cm.message.startsWith("/") ) {
                    runCommand(source, cm.name, cm.message);
                    return;
                }

                System.out.println("Broadcasting:" + m + "  reliable:" + m.isReliable());

                // Just rebroadcast... the reliable flag will stay the
                // same so if it came in on UDP it will go out on that too
                source.getServer().broadcast(cm);
            } else {
                System.err.println("Received odd message:" + m);
            }
        }
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