I believe the telnet API is only available within a Driver, not an App. You should be able to keep all of the Telnet logic, including reconnect logic, all within the driver.
Drivers are used by devices, which expose Attributes and Commands that are then used by Applications.
You can create a repeating scheduled routine within the driver that periodically checks on the overall health of the Telnet connection, and then have it reconnect. Most times, though, the driver gets notified that the Telnet session has ended. Based on this event, the driver can then start to attempt reconnecting periodically, until the session is reestablished. Usually, the Apps that would be using the driver need never know exactly how the device is connected to the physical hardware (Telnet, webSocket, Zigbee, Z-Wave, etc...)