TN5250 does not respond to Telnet Are You There - IAC(255) AYT(246). Ref rfc854.
If IAC AYT is sent to the host (i.e. iSeries) it responds with IAC DM (Data Mark 242).
My suggestion is that TN5250 responds the same way to an AYT request.
This is important, because the host cannot easily tell whether TN5250 is still connected, since it does not properly close the socket (see 1793766) and the host needs to be able to send something harmless in order to determine the connection status.
Hi, if you are still experiencing this problem, please open an issue at https://github.com/tn5250/tn5250/issues