Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
Irdis #1
Member since Sep 2012 · 10 posts
Group memberships: Members
Show profile · Link to this post
Subject: Several connections crashes app
When i have several connection and try to connect them simultaneously agsXmpp crashes my proccess. Another maybe usefull thing that I establish connection from one thread (connection.Open()). Also straight before crash happens I catch InvalidTokenException.

May be I should wait while first client is loged in and only then connect to another server??
My agsXMPP version 1.1.0.0.
And how can i deal with that kind of crashes?
Exception:
An unhandled exception occurred and the process was terminated.

Application ID: DefaultDomain

Process ID: 4012

Exception: System.InvalidOperationException

Message: EndRead can only be called once for each asynchronous operation.

StackTrace:    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.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
   at System.Net.Security._SslStream.ProcessFrameBody(Int32 readBytes, Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security._SslStream.ReadFrameCallback(AsyncProtocolRequest asyncRequest)
   at System.Net.AsyncProtocolRequest.CompleteRequest(Int32 result)
   at System.Net.FixedSizeReader.CheckCompletionBeforeNextRead(Int32 bytes)
   at System.Net.FixedSizeReader.ReadCallback(IAsyncResult transportResult)
   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, Boolean ignoreSyncCtx)
   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)
This post was edited 3 times, last on 2012-09-10, 19:42 by Irdis.
Avatar
Alex #2
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
When you have multiple connections you must use a new XmppClientConnection instance for each connection. This should be no problem at all.

Alex
Avatar
Irdis #3
Member since Sep 2012 · 10 posts
Group memberships: Members
Show profile · Link to this post
for shure i have one-to-one relation between XmppClientConnection and own Client representation...
maybe smth. else. This crash really bother me. :(
also thx for quick replies :)
Avatar
Alex #4
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
A Xml log would help there, or a socket log. InvalidTokenException normally means that invalid Xml was received over the socket.
It looks like the exceptions happens in the .NET SslStream class.

Alex
Avatar
Irdis #5
Member since Sep 2012 · 10 posts
Group memberships: Members
Show profile · Link to this post
hope this helps...
Also I can't find a normal way to reproduce that. But it rarely happens when I have not stable connection to the internet.
The author has attached one file to this post:
1.txt 14.1 kBytes
You have no permission to open this file.
This post was edited on 2012-09-10, 20:42 by Irdis.
Avatar
Alex #6
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
I see many authentication errors in your logfile:
  1. <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><invalid-authzid /></failure>

If you don't close the stream properly after this errors agsXMPP will have problems I guess.

Alex
Avatar
Irdis #7
Member since Sep 2012 · 10 posts
Group memberships: Members
Show profile · Link to this post
Alex, you are right. I should be more carefull with session.
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