Location in source:
|
throw new TNHostException("The TN3270 connection was lost", this.currentConnection.DisconnectReason, null); |
Specifically, this.currentConnection is sometimes null when this line of code is executed.
I believe this can be fixed by changing this.currentConnection.DisconnectReason to this.DisconnectReason, which checks this.currentConnection for null.
Context: We're using Open3270 to automate a third-party terminal that sometimes experiences long response times. We need a way to interrupt Open3270 when this happens. We'd like the interruption to be immediate and graceful, if possible. Currently we interrupt the wait by calling TNEmulator.Close from a different thread. However, this causes the above line of code to be executed when this.currentConnection is null, masking the intended TNHostException.