Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
s.ghasemi #1
Member since Jul 2017 · 29 posts
Group memberships: Members
Show profile · Link to this post
Thanks for the reply.
My manager has insisted to do this test and just wanna know how i can find the time it takes since sending till delivering a message.

Does this code help me?
If yes, could you please replay these 3 questions?

Quote by Alex on 2006-04-18, 22:33:
Here is a c# sample

Client 1 sends a message and requests the displayed event. The messages need a unique id which i generated here with the GenerateId() method.

  1. agsXMPP.protocol.client.Message msg = new agsXMPP.protocol.client.Message();
  2. msg.From = new Jid("romeo@montague.net");
  3. msg.To = new Jid("juliet@capulet.com");
  4. msg.GenerateId();
  5. msg.Body = "Hello World";
  6. // Add the event to the message
  7. agsXMPP.protocol.x.Event ev = new Event();
  8. ev.Displayed = true;
  9. msg.AddChild(ev);

When client 2 receives this message and is sending the displayed notification to client 1

  1. agsXMPP.protocol.client.Message msg2 = new agsXMPP.protocol.client.Message();
  2. msg2.From = new Jid("juliet@capulet.com");
  3. msg2.To = new Jid("romeo@montague.net");
  4. // Add the event to the message           
  5. agsXMPP.protocol.x.Event ev2 = new Event();
  6. ev2.Displayed = true;
  7. ev2.Id = msg.Id;
  8. msg2.AddChild(ev2);

Alex
----------------------------Questions--------------------------------------
1. Where do we put these codes which are in part 1 and 2 of client ?
2. Since I didnt see the send function, is the first part of the code enough to send the message?
3. Should i put the secend code in OnRecieve event of second client?

Thanks a lot.
This post was edited 2 times, last on 2017-07-31, 13:31 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
no this does not help you.

XMPP is realtime. Delivering a message takes only milliseconds. The only factors which can slow it down are slow networks or a server which is too busy.

Alex
Avatar
s.ghasemi #3
Member since Jul 2017 · 29 posts
Group memberships: Members
Show profile · Link to this post
I tried the below code but it was just the sending time. and there wasnt the delivering time.And its time was strangely few.so I decieded to use  the delivery time too.
Isnt way to find the time between sending to delivering??

  1. agsXMPP.protocol.client.Message msg = new agsXMPP.protocol.client.Message();
  2. msg.Type = MessageType.chat;
  3.  
  4. msg.To = new Jid("sajad@localhost");
  5. msg.Body = "fff";
  6. int i;
  7. var startTime = DateTime.Now;
  8. for (i = 0; i < 100000; i++)
  9. {
  10.     cnn.Send(msg);
  11. }
  12. var endTime = DateTime.Now;
  13. var sendedTime = endTime - startTime;

sendedTime= 2 sec!!!!
This post was edited on 2017-07-31, 14:30 by Alex.
Avatar
Alex #4
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Just send an Xmpp ping to the client or the server and measure the response time.

See XEP-0199: XMPP Ping
Avatar
s.ghasemi #5
Member since Jul 2017 · 29 posts
Group memberships: Members
Show profile · Link to this post
Thanks Alex.
I read XEP-0199: XMPP Ping.

Could you explain more?or introduce a sample of it in .net?
This post was edited on 2017-07-31, 17:29 by Alex.
Avatar
s.ghasemi #6
Member since Jul 2017 · 29 posts
Group memberships: Members
Show profile · Link to this post
Hi Alex,
I found a sample code, How can i use that in my test.

  1. /*
  2. * Client pings a server
  3. *
  4. * <iq to='capulet.lit' id='c2s1' type='get'>
  5. *      <ping xmlns='urn:xmpp:ping'/>
  6. * </iq>
  7. */
  8.  
  9. PingIq piq = new PingIq(new agsXMPP.Jid("capulet.lit"));
  10. piq.Type = agsXMPP.protocol.client.IqType.get;
  11. piq.Id = "c2s1";
  12. Program.Print(piq);
This post was edited on 2017-07-31, 19:44 by 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: agsXMPP RSS