I have a couple applications that communicate over TCP/UDP sockets. Each one has a different set of commands (protocol) that it follows and different expected returns. I've been trying to compile a list of commands with parameters, types, return values, error codes, exceptions, etc. but I'm stuck on formatting it.
Example command (a simple one):
LISTPLAYERS:ROOMID
// ROOMID is an integer
// Returns list of players in format:
// PLAYERID:PLAYERNAME
// Until ended with:
// OK
What is the best method for documenting this? (I'm asking for documentation standards, formatting ideas, programs, etc.)
Edit: I found an example of the ICQ protocol. I'm looking for a standard for documenting communication like this, or at least a better way to do it.