AdhamAwadhi / JamaaSMPP

Jamaa SMPP Client is a .NET implementation of the SMPP protocol that focuses on providing an easy-to-use and robust SMPP client library for .NET developers. This project is intended to be used by developers who want to integrate SMS functionalities in their applications as well as students who are learning the SMPP protocol.
https://github.com/AdhamAwadhi/JamaaSMPP/wiki
Other
45 stars 35 forks source link

NULL Reference Exception on Continual Connection Error #47

Open danielckelly opened 3 years ago

danielckelly commented 3 years ago

Hi, If you enter the wrong SMPP details or there are continual connection issues, eventually (usually within 10 minutes) you get an exception that crashes the entire application (no just the SMPP client) as we have everything wrapped around a Try / Catch Block and the exception does not get thrown back to the calling method.

Source is JamaaTech.Smpp.Net.Lib

The exception Stack Trace is as follows:-

at JamaaTech.Smpp.Net.Lib.StreamParser.RaiseParserExceptionEvent(Exception exception) at JamaaTech.Smpp.Net.Lib.StreamParser.HandleException(Exception ex) at JamaaTech.Smpp.Net.Lib.StreamParser.WaitPDU() at JamaaTech.Smpp.Net.Lib.StreamParser.RunNow() at JamaaTech.Smpp.Net.Lib.Util.RunningComponent.ThreadCallback() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()

And Excedption Details:-

System.NullReferenceException was unhandled HResult=-2147467261 Message=Object reference not set to an instance of an object. Source=JamaaTech.Smpp.Net.Lib StackTrace: at JamaaTech.Smpp.Net.Lib.StreamParser.RaiseParserExceptionEvent(Exception exception) at JamaaTech.Smpp.Net.Lib.StreamParser.HandleException(Exception ex) at JamaaTech.Smpp.Net.Lib.StreamParser.WaitPDU() at JamaaTech.Smpp.Net.Lib.StreamParser.RunNow() at JamaaTech.Smpp.Net.Lib.Util.RunningComponent.ThreadCallback() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException:

Thanks,

Daniel.

danielckelly commented 3 years ago

Upon loading the source, visual studio is breaking inside StreamParser.cs - Line 112 (inside Method RunNow()) which has a Single Throw Statement on it ( http://btg.io/dk/JamaaException.png )