Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar
AliVireTechnologies1 #1
Member since Jun 2013 · 58 posts
Group memberships: Members
Show profile · Link to this post
Subject: marix library 1.5.2.4, user is not registering
em using this following code ...  this code is giving an error message of cross thread and other this message application halt.



 Model.Utility.xmppClient.Dispatcher = this.Dispatcher;
 Model.Utility.xmppClient.OnRegisterInformation += new EventHandler<RegisterEventArgs>(xmppClient_OnRegisterInformation);
 Model.Utility.xmppClient.OnRegisterError += new EventHandler<Matrix.Xmpp.Client.IqEventArgs>(xmppClient_OnRegisterError);



Model.Utility.SetLicense();
Model.Utility.xmppClient.Username = txtphone.Text;
 Model.Utility.xmppClient.SetXmppDomain(Model.Utility.Domain);
Model.Utility.xmppClient.Password = "password";
Model.Utility.xmppClient.RegisterNewAccount = true;
Model.Utility.xmppClient.Open();

  private void xmppClient_OnRegisterInformation(object sender, RegisterEventArgs e)
        {
            e.Register.RemoveAll<Data>();

            e.Register.Username = Model.Utility.xmppClient.Username;
            e.Register.Password = Model.Utility.xmppClient.Password;
        }

        private void xmppClient_OnRegister(object sender, EventArgs e)
        {
            // registration was successful
        }

        private void xmppClient_OnRegisterError(object sender, IqEventArgs e)
        {
            // registration failed.
            Model.Utility.xmppClient.Close();
        }

//====================================

stack trace

=======================
{System.UnauthorizedAccessException: Invalid cross-thread access.
   at MS.Internal.XcpImports.CheckThread()
   at MS.Internal.XcpImports.DispatcherTimer_Stop(DispatcherTimer timer)
   at System.Windows.Threading.DispatcherTimer.Stop()
   at Matrix.XmppStream.DestroyKeepAliveTimer()
   at Matrix.XmppStream.Close()
   at Matrix.XmppStream.#=qXGDjopseCfmlIP5_mm1VoQ==(Object #=qVi4zofNC9IJTEWIShRRs9Q==, ExceptionEventArgs #=q5Z3umlhq7Pk9XPrHYD2h3w==)
   at Matrix.Net.BaseSocket.FireOnError(Exception ex)
   at Matrix.Net.ClientSocket.#=qvHrMepci4h6v_irb5D9l7RO$I8MA$BYvfax8ZFxp5BM=.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Matrix.Xmpp.Client.XmppClient.#=qsJo1pDRARWdebyfRzcbMWNy0_lciMdmML58vM$jckXI=.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>b__1(Object state)
   at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
   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.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()}
Avatar
Alex #2
Member since Feb 2003 · 4296 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
please try the latest builds. We have fixed similar exceptions in the latest builds.

Alex
Avatar
AliVireTechnologies1 #3
Member since Jun 2013 · 58 posts
Group memberships: Members
Show profile · Link to this post
I did tls property to false, it is working now thankx.
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: MatriX RSS