My TELNET Class for Xojo

Hi everyone. I wanted to share my Xojo TELNET Class that I wrote. I needed a TELNET class that properly negotiated the IAC Options that I wanted to maximize my connection efficiency. I wrote a very basic Terminal front end as a part of this for example implementation of the class. I develop on MacOS so I have tested this on OS 10.8.4 FYI.

Here is the link:
Xojo TELNET class Link

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
TELNET Class

Class version: 102
Xojo version: 2013 R3.3

Written By: Mike Cotrone (Twitter: ‘@mikecotrone’ Email: homeseer.cotrone@gmail.com)

I wrote this TELNET class since Xojo doesn’t have a TELNET class yet and I need to properly negotiate TELNET IAC options with my remote hosts in order to properly and efficiently retreive information. This Xojo code is free to use and has no disclaimers or warranties. Use at your own risk and please email me any suggestions.

I didn’t implement all of the TELNET options primarly due to the age of this protocol. We do not live in the world of IBM hosts or
TN3270 emulation any longer, bandwidth is plentiful, and half duplex communication is dead :slight_smile:

The Basic Terminal front end is just for a Socket Implementation example only since it is very very basic. :slight_smile:

SUPPORTED OPTIONS:

  1. ECHO - User can toggle checkbox (True/False) on Window1 GUI to enabled/disable

  2. NAWS - User can toggle checkbox (True/False) to enable/disable and set Width/Length on Window1

  3. TERMINAL SPEED - User can toggle checkbox (True/False) to enable/disable and set Terminal speed on Window1

  4. REMOTE FLOW CONTROL - User can toggle checkbox (True/False) to enable/disable and set Flow Control Type on Window1

  5. SUPPRESS GO AHEAD - User can toggle checkbox (True/False) to enable/disable on Window1

  6. TERMINAL TYPE - User can toggle checkbox (True/False) to enable/disable and Select terminal Type (which can you can expand on Window1 controls)

OPTIONS THAT ARE HARD CODED/ NO NEGOTIATIONS WITH DEFAULT BEHAVIOR:

  1. AUTHENTICATE - We will send “IAC WONT AUTHENTICATE” (Comment: really? :slight_smile: This was funny when I found RFC 2941)

  2. LINEMODE - We will send “IAC WONT LINEMODE”

  3. X DISPLAY - We will send “IAC WONT XDISPLAY”

  4. STATUS - We will send “IAC WONT STATUS”

  5. NEW ENVIRONMENT - We will send “IAC WONT NEW ENVIRONMENT”

REGRESSION TESTED ON:

  1. Cisco 2921, 6500, and 1841 Routers running late IOS (12.2 - 15.x)
  2. Juniper JunOS

Added in Version 1.0(5):

  • X Display Location (Pulls Display from OS)
  • New Environment (Pulls Display and USER from OS)
  • (1.04) LOGOUT OPTION (RFC-727) - User can toggle checkbox (True/False) to respond to Server’s IAC DO LOGOUT
  • (1.04) TIMING MARK (RFC-860)- User can toggle checkbox (True/False) to enable/disable timing markers.

Regression Tested on MAC OS using the following TELNETd Servers:

  • Ubuntu 12.04.2 LTS (But Uncheck NAWS or find a length and width Ubuntu likes :))
  • Cisco IOS 12.x, 15.x
  • JunOS

I have established a GitHub repository to make it easier as I am finding little bugs and fixing them :slight_smile:

Xojo TELNET Class GitHub Public Repository