A TCP/Telnet client, "munged" together from the sample "Telnet Client" and "Wifi Client" Arduino Sketches, intended for the ESP8266
This code likely looks messy but it works. I just needed a sketch to connect and "listen" to a Telnet/TCP server (LIRC on port 8765) for the purpose of toggling the builtin LED with an IR remote control. This could probably used for other implementations, so I decided to publish my first "functional" sketch that I'm pretty sure is unique. Because I spent a while looking for this solution myself, I hope that it will be useful to someone else.