Arduino Tutorial : AdvancedChat Server
A more sophisticated server that distributes any incoming messages to all connected clients except the one that is sending the message. Any incoming text will be sent to all connected clients (including the one typing). Additionally, you will be able to see the client’s input in your serial monitor as well.