Sunday, October 9, 2011

Another advantage of JSON: Telnet

The advantage of using a string-based protocol like JSON is that I can use a telnet client to connect to the server and to communicate with it. This allows me to examine and test the netcode directly without having to implement it in the graphical client first. I can craft short JSON messages and read the exact JSON reply.

When something doesn't work, telnetting my server helps me to troubleshoot whether it's my server which sends  no or incorrect information or my client which doesn't react to it correctly.

With a binary protocol I would have to use Wireshark to sniff on the connection between client and server and then examine the hex code to get an idea of what's happening.

No comments:

Post a Comment