Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
skumar6 #1
Member since May 2011 · 4 posts
Group memberships: Members
Show profile · Link to this post
Subject: Getting exception: System.ArgumentException: The parameter: System.Net.Sockets.OverlappedAsyncResult
We are using agsXMPP.dll(Version 1.1.0.0) .NET library in our code where we are getting some random exceptions which are not easily reproducable when there is network outage or our XMPP server goes down. It results in crash and shuts down our application. Looks like the network outage or connection loss  Following is the call stack for crash. Is there any patch for this issue?

System.ArgumentException: The parameter: System.Net.Sockets.OverlappedAsyncResult is not valid. Use the object returned from corresponding Begin async call.
Parameter name: asyncResult
   at System.Net.Security._SslStream.EndRead(IAsyncResult asyncResult)
   at System.Net.Security.SslStream.EndRead(IAsyncResult asyncResult)
   at agsXMPP.net.ClientSocket.EndReceive(IAsyncResult ar)
   at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
   at System.Net.ContextAwareResult.CompleteCallback(Object state)
   at System.Threading.ExecutionContext.runTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Net.ContextAwareResult.Complete(IntPtr userToken)
   at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
   at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
   at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
2011-04-15 22:17:30,781 DEBUG 5340 Avaya.OneXAgent.CMService.PhoneService.Utils End Executing method ListenAndTalk
2011-04-15 22:17:30,781 ERROR 5340 OneXAgentUI.MainWindow Exception:
VoiceInteraction_ListenAndTalk failed;Avaya.OneXAgent.OneXAgentException: ObserveMode did not change to ListenAndTalk ---> Avaya.OneXAgent.CMService.Utils.PhoneServiceException: ObserveMode did not change to ListenAndTalk
   at Avaya.OneXAgent.CMService.PhoneService.PhoneServiceImpl.<ValidateObserveModeChangedToListenAndTalk>b__f2() in m:\wi00874859_1xagent-2.5_2.5.0.0.00465\1xagent\src\csharp\OneXAgent\OneXAgentCMService\Avaya.OneXAgent.CMService.PhoneService\PhoneServiceImpl.cs:line 2242
   at Avaya.OneXAgent.CMService.PhoneService.Utils.CheckConditionAndHandleError(String conditionName, Int32 timeout, Int32 tries, Condition condition, Action errorHandler) in m:\wi00874859_1xagent-2.5_2.5.0.0.00465\1xagent\src\csharp\OneXAgent\OneXAgentCMService\Avaya.OneXAgent.CMService.PhoneService\Utils.cs:line 28
   at Avaya.OneXAgent.CMService.PhoneService.PhoneServiceImpl.ValidateObserveModeChangedToListenAndTalk() in m:\wi00874859_1xagent-2.5_2.5.0.0.00465\1xagent\src\csharp\OneXAgent\OneXAgentCMService\Avaya.OneXAgent.CMService.PhoneService\PhoneServiceImpl.cs:line 2239
   at Avaya.OneXAgent.CMService.PhoneService.PhoneServiceImpl.<>c__DisplayClassfc.<ListenAndTalk>b__fb() in m:\wi00874859_1xagent-2.5_2.5.0.0.00465\1xagent\src\csharp\OneXAgent\OneXAgentCMService\Avaya.OneXAgent.CMService.PhoneService\PhoneServiceImpl.cs:line 2307
   at Avaya.OneXAgent.CMService.PhoneService.Utils.WrapMethodCall(String methodName, Action action, Object[] parms) in m:\wi00874859_1xagent-2.5_2.5.0.0.00465\1xagent\src\csharp\OneXAgent\OneXAgentCMService\Avaya.OneXAgent.CMService.PhoneService\Utils.cs:line 37
   at Avaya.OneXAgent.CMService.PhoneService.PhoneServiceImpl.ListenAndTalk() in m:\wi00874859_1xagent-2.5_2.5.0.0.00465\1xagent\src\csharp\OneXAgent\OneXAgentCMService\Avaya.OneXAgent.CMService.PhoneService\PhoneServiceImpl.cs:line 2303
   at Avaya.OneXAgent.WorkService.WorkServiceImpl.ListenAndTalk(VoiceInteraction vi) in m:\wi00874859_1xagent-2.5_2.5.0.0.00465\1xagent\src\csharp\OneXAgent\OneXAgentWorkService\Avaya.OneXAgent.WorkService\WorkServiceImpl.cs:line 678
   at Avaya.OneXAgent.Work.VoiceInteractionImpl.ListenAndTalk() in m:\wi00874859_1xagent-2.5_2.5.0.0.00465\1xagent\src\csharp\OneXAgent\OneXAgentCore\Avaya.OneXAgent.Work\VoiceInteractionImpl.cs:line 113
   --- End of inner exception stack trace ---
   at Avaya.OneXAgent.Work.VoiceInteractionImpl.ListenAndTalk() in m:\wi00874859_1xagent-2.5_2.5.0.0.00465\1xagent\src\csharp\OneXAgent\OneXAgentCore\Avaya.OneXAgent.Work\VoiceInteractionImpl.cs:line 115
   at OneXAgentUI.MainWindow.BargeInHandler(Object sender, ExecutedRoutedEventArgs e) in m:\wi00874859_1xagent-2.5_2.5.0.0.00465\1xagent\src\csharp\OneXAgent\OneXAgentUI\MainWindow.xaml.cs:line 2054
   at OneXAgentUI.MainWindow.GUIMethodHandler.Executed(Object sender, ExecutedRoutedEventArgs e) in m:\wi00874859_1xagent-2.5_2.5.0.0.00465\1xagent\src\csharp\OneXAgent\OneXAgentUI\MainWindow.xaml.cs:line 1694
 

Thanks
Sushil
Avatar
Alex #2
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hello Sushil,

such an error was not reported before, so we have no patch for this.
Do you have a test case which we can use to cause this error?

Can you try to catch also System.ArgumentExceptions in ClientSocket.EndReceive to see if this will catch the exception? If this helps then I can provide a patch.

Alex
Avatar
skumar6 #3
Member since May 2011 · 4 posts
Group memberships: Members
Show profile · Link to this post
Hi Alex,
Thanks for prompt reply. We purchased commerical license for this library to distribute with our product. I believe we are using binaries only and don't have code or it was not taken. I will try to see if I can find code and modify it.

The problem is that it is not eaisly reproducable and don't know when it occurs. We know for sure that it happens only when there is physical network outage or XMPP server goes down which again is another form of network outage.

Another alternate way due to our release timeframe, which I am thinking, is to take care this in our code where we calling this library. We are using XmppClientConnection object to open and close connection to XMPP server. Whenever there is problem in connection we are getting notification. I think whenever I am getting this breakage notfication then I will call XmppClientConnection.close(). This will cancel any pending readout operation and probabaly the crash due to this. Later on we can reopen connection. Please let me know what do you think about this?

Once again I appriciate your prompt help.

Thanks a lot
Sushil Kumar
Avatar
Alex #4
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
The latest code is located here:
svn://svn.ag-software.de/agsxmpp

If you have not updated for a while then you may need to change some class names in your code. I fixed some naming conventions a while ago.

The only reference to agsXMPP in your exception is the EndRead callback. My assumption is that this exception is manhandled in the .NET Framework and then goes up the call stack. When your code runs with the latest sources I can commit a patch to catch all exceptions in this callback to see if it helps. When you let my know which framework you target I can also create a new binary for you.

Alex
Avatar
skumar6 #5
Member since May 2011 · 4 posts
Group memberships: Members
Show profile · Link to this post
Thanks a lot Alex.

We are using .NET 3.5 SP1 framework our application. Would it be possible for you create patch for 1.1.0.0 code base as this is tested with our application and due to our release date I may not able to take binaries from new code base. Later in our next release we can consider latest binaries from latest code base. Also as we have purchased commerical license of this library for our product then please let me know other formalities which we have to follow. We are already in process of starting formal thread with support folks.


Thanks a lot for your lightening fast response and help.

Thanks
Sushil Kumar
Avatar
Alex #6
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
I have attached a debug version with catches all errors in EndReceive now. Please let me know if this helps.
Debug symbols are also included, if it does not help you should be able to debug the problem.

Alex
The author has attached one file to this post:
debug.zip 499.4 kBytes
You have no permission to open this file.
Avatar
skumar6 #7
Member since May 2011 · 4 posts
Group memberships: Members
Show profile · Link to this post
Thanks Alex for the binaries. I will test it let you know. It may take some time to come back to you as issue is not easy to reproducable.

Thanks
Sushil Kumar
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP RSS