Here’s a basic chat server written in Processing. It’s a bit more complex than the basic test server. This server keeps track of all the clients who log into it in an ArrayList. Using an ArrayList is useful when you need to do more complex things with the clients, as in my pong server from Making Things Talk. This is the most minimal server I could come up with that keeps a list of its clients.
[include file="../../code/Processing/chat_server/chat_server.pde" clean="true"]