I've been further experimenting with ranch to implement a proper Telnet implementation (for those who thought Telnet was simply a TCP connection from A to B...nope..)
First, I wanted to compliment the softwre engineers who worked on gen_statem, it's a fantastic replacement for gen_fsm which consolidates a lot of previously seperate functions into something that is simpler to implement, but has a lot more functionality.
As part of the Telnet negotiation process, I am having to send a string of IAC codes to specify no echo, character mode, etc. to get the terminal characteristics that I want:
but now that I am sending this data, I am getting the terminal characteristics that I want, but as part of the negotiation, the client not only acknowledges the attributes that I wanted, but the client responds with attributes of its own: