The application crashes due to an unhandled exception from NMS API. The "NullReferenceException" from Apache.NMS.ActiveMQ.Transport.InactivityMonitor.WriteCheck() is logged in event viewer.
With reference to https://issues.apache.org/jira/browse/AMQNET-339, already null check is done for asyncWriteTask in WriteCheck(). But still with that fix, we got the unhandled null reference exception. After checking null for asyncTasks before calling "this.asyncTasks.Wakeup();", our issue was fixed and we didnot get any further exception from WriteCheck().