@Override
    public void run()
    {
        try
        {
            String message = input.nextLine(); //IMPORTANT blocking call
            String [] stringarray = message.split("#");
            String protocolcommand = stringarray[0];
            if (message.equals("CONNECT#"))
            {
                ChatServer.Online();
            }
            Logger.getLogger(ChatServer.class.getName()).log(Level.INFO, String.format("Received the message: %1$S ",message));
            while (!message.equals(ProtocolStrings.STOP)) {
                ChatServer.send(message);
                Logger.getLogger(ChatServer.class.getName()).log(Level.INFO, String.format("Received the message: %1$S ",message.toUpperCase()));
                message = input.nextLine(); //IMPORTANT blocking call
            }
            writer.println(ProtocolStrings.STOP);//Echo the stop message back to the client for a nice closedown
            socket.close();
            Logger.getLogger(ChatServer.class.getName()).log(Level.INFO, "Closed a Connection");
        } catch (IOException ex)
        {
            Logger.getLogger(ClientHandler.class.getName()).log(Level.SEVERE, null, ex);
        }
    }