Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar
Babu #1
Member since Apr 2016 · 7 posts
Group memberships: Members
Show profile · Link to this post
Subject: VCard Set IqFilter.SendIqAsync Hangs up
Hi All,

I am doing the following steps.

1. I am registering a new user
2. In the OnRegister callback, logging into the system with the new user.
3. In the OnLogin callback, setting the VCard. But here the system hangs up . The code is as follows.

  1. var viq = new VcardIq { Type = Matrix.Xmpp.IqType.Set };
  2.  
  3. if (!string.IsNullOrEmpty(UserId))
  4.     viq.Vcard.Jid = UserId;
  5. if (!string.IsNullOrEmpty(FullName))
  6.     viq.Vcard.Fullname = FullName;
  7.  
  8. var iq = await xmppClient.IqFilter.SendIqAsync(viq);

On executing the last line, the system hangs up.

Please help to solve this.

Thanks & Regards
Babu
This post was edited on 2016-04-08, 13:36 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4296 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
OnLogin is usually to early. Please wait until you get your first incoming OnPresence packet.

How does your debug Xml look?
Avatar
Babu #3
Member since Apr 2016 · 7 posts
Group memberships: Members
Show profile · Link to this post
Hi Alex,

Thank you. Appreciate your prompt response.

As you said, I tried in my first presence. Works fine.

Thanks Again.

Babu
Avatar
Alex #4
Member since Feb 2003 · 4296 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
great to hear that its working now.

In the OnLogin event you have no resource assigned yet. Which means that Iqs cannot work usually before the resource is assigned (OnBind). But as suggested you should always wait for the OnPresence which means the session is fully ready.

Alex
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