Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar
skhanna #1
Member since Jul 2016 · 73 posts · Location: Indore
Group memberships: Members
Show profile · Link to this post
Subject: Event Execution Flow
Hi Alex,

I have logged all events in log file and try to understand. I have few queries:

(1) Every 5 minutes OnSendXML event is executing. I think due to that because  have set KeepAliveInterval =5. Right? Can I set max    value. Is there any disadvantage if I set max value in KeepAliveInterval.

(2) I did not understand below Stanza on OnSendXML event at the time of login.

OnSendXML: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="eworkplace0" version="1.0" >

(3) I did not understand below Stanza on OnReceiveXML event at the time of login.

OnReceiveXML: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="eworkplace0" id="4g6vuvuknj" xml:lang="en" version="1.0" >

(4) I did not understand below Stanza on OnReceiveXML event at the time of login after above xml


Log Entry : 12:36:38 PM Sunday, August 07, 2016
  :
  :connect: XMPP connecting....
-------------------------------

Log Entry : 12:36:44 PM Sunday, August 07, 2016
  :
  :OnSendXML: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="eworkplace0" version="1.0" >
-------------------------------

Log Entry : 12:36:44 PM Sunday, August 07, 2016
  :
  :OnReceiveXML: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="eworkplace0" id="4g6vuvuknj" xml:lang="en" version="1.0" >
-------------------------------

Log Entry : 12:36:45 PM Sunday, August 07, 2016
  :
  :OnReceiveXML: <stream:features xmlns:stream="http://etherx.jabber.org/streams">
  <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
  <mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
    <mechanism>PLAIN</mechanism>
    <mechanism>SCRAM-SHA-1</mechanism>
    <mechanism>CRAM-MD5</mechanism>
    <mechanism>DIGEST-MD5</mechanism>
  </mechanisms>
  <compression xmlns="http://jabber.org/features/compress">
    <method>zlib</method>
  </compression>
  <auth xmlns="http://jabber.org/features/iq-auth" />
  <register xmlns="http://jabber.org/features/iq-register" />
</stream:features>
-------------------------------

Log Entry : 12:36:45 PM Sunday, August 07, 2016
  :
  :OnSendXML: <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
-------------------------------

Log Entry : 12:36:45 PM Sunday, August 07, 2016
  :
  :OnReceiveXML: <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
-------------------------------

Log Entry : 12:36:46 PM Sunday, August 07, 2016
  :
  :OnSendXML: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="eworkplace0" version="1.0" >
-------------------------------

Log Entry : 12:36:47 PM Sunday, August 07, 2016
  :
  :OnReceiveXML: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="eworkplace0" id="4g6vuvuknj" xml:lang="en" version="1.0" >
-------------------------------

Log Entry : 12:36:47 PM Sunday, August 07, 2016
  :
  :OnReceiveXML: <stream:features xmlns:stream="http://etherx.jabber.org/streams">
  <mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
    <mechanism>PLAIN</mechanism>
    <mechanism>SCRAM-SHA-1</mechanism>
    <mechanism>CRAM-MD5</mechanism>
    <mechanism>DIGEST-MD5</mechanism>
  </mechanisms>
  <compression xmlns="http://jabber.org/features/compress">
    <method>zlib</method>
  </compression>
  <auth xmlns="http://jabber.org/features/iq-auth" />
  <register xmlns="http://jabber.org/features/iq-register" />
</stream:features>
-------------------------------

Log Entry : 12:36:47 PM Sunday, August 07, 2016
  :
  :OnSendXML: <auth mechanism="SCRAM-SHA-1" xmlns="urn:ietf:params:xml:ns:xmpp-sasl">biwsbj0wNGEwYTYzZS1hMmZjLTQ2NjMtODhiYS0zYzgyNzJkMTY4OGUscj1ycjlmU0RPcE1QZnpRV2xsNmRDbXVlWXVkRFJMdms1dQ==</auth>
-------------------------------

Log Entry : 12:36:47 PM Sunday, August 07, 2016
  :
  :OnSendXML: 
-------------------------------

Log Entry : 12:36:47 PM Sunday, August 07, 2016
  :
  :OnReceiveXML: <challenge xmlns="urn:ietf:params:xml:ns:xmpp-sasl">cj1ycjlmU0RPcE1QZnpRV2xsNmRDbXVlWXVkRFJMdms1dTk5N2FhZjljLTZiNDktNDY0My1hYzM3LTEzZTBlZmI0YmM0MSxzPVZUckg4TXpPVmlHcWZma29aS294d2tBNEdDaUxMajZtLGk9NDA5Ng==</challenge>
-------------------------------

Log Entry : 12:36:47 PM Sunday, August 07, 2016
  :
  :OnSendXML: <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">Yz1iaXdzLHI9cnI5ZlNET3BNUGZ6UVdsbDZkQ211ZVl1ZERSTHZrNXU5OTdhYWY5Yy02YjQ5LTQ2NDMtYWMzNy0xM2UwZWZiNGJjNDEscD1OS1dhMFNldlNHeGErZkh1UzRLaFNMRWVQRGM9</response>
-------------------------------

Log Entry : 12:36:48 PM Sunday, August 07, 2016
  :
  :OnReceiveXML: <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl">dj1BSjdoOHVHVWxWb3FvYStLVlBNVXdqaTV4eW89</success>
-------------------------------

Log Entry : 12:36:48 PM Sunday, August 07, 2016
  :
  :OnLogin
-------------------------------

Log Entry : 12:36:48 PM Sunday, August 07, 2016
  :
  :OnSendXML: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="eworkplace0" version="1.0" >
-------------------------------

Log Entry : 12:36:48 PM Sunday, August 07, 2016
  :
  :OnReceiveXML: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="eworkplace0" id="4g6vuvuknj" xml:lang="en" version="1.0" >
-------------------------------

Log Entry : 12:36:48 PM Sunday, August 07, 2016
  :
  :OnReceiveXML: <stream:features xmlns:stream="http://etherx.jabber.org/streams">
  <compression xmlns="http://jabber.org/features/compress">
    <method>zlib</method>
  </compression>
  <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind" />
  <session xmlns="urn:ietf:params:xml:ns:xmpp-session">
    <optional />
  </session>
  <sm xmlns="urn:xmpp:sm:2" />
  <sm xmlns="urn:xmpp:sm:3" />
</stream:features>
-------------------------------

Log Entry : 12:36:48 PM Sunday, August 07, 2016
  :
  :OnSendXML: <iq id="MX_1" type="set" xmlns="jabber:client">
  <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">
    <resource>MatriX</resource>
  </bind>
</iq>
-------------------------------

Log Entry : 12:36:48 PM Sunday, August 07, 2016
  :
  :OnReceiveXML: <iq type="result" id="MX_1" to="eworkplace0/4g6vuvuknj" xmlns="jabber:client">
  <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">
    <jid>04a0a63e-a2fc-4663-88ba-3c8272d1688e@eworkplace0/MatriX</jid>
  </bind>
</iq>
-------------------------------

Log Entry : 12:36:48 PM Sunday, August 07, 2016
  :
  :OnBind: XMPP connected. JID: 04a0a63e-a2fc-4663-88ba-3c8272d1688e@eworkplace0/MatriX
-------------------------------

Log Entry : 12:36:48 PM Sunday, August 07, 2016
  :
  :OnSendXML: <iq id="MX_2" type="get" xmlns="jabber:client">
  <query xmlns="jabber:iq:roster" />
</iq>
-------------------------------

Log Entry : 12:36:49 PM Sunday, August 07, 2016
  :
  :OnReceiveXML: <iq type="result" id="MX_2" to="04a0a63e-a2fc-4663-88ba-3c8272d1688e@eworkplace0/MatriX" xmlns="jabber:client">
  <query xmlns="jabber:iq:roster">
    <item jid="6963fffb-4a1d-44e0-a19d-68cb4a991448@eworkplace0" name="6963fffb-4a1d-44e0-a19d-68cb4a991448" subscription="both" />
    <item jid="6dee57c9-ea8a-41b8-ada8-2979c7c5a814@eworkplace0" name="6dee57c9-ea8a-41b8-ada8-2979c7c5a814" subscription="both" />
    <item jid="7e027929-e86e-41bf-9fc4-636b5f5c3a59@eworkplace0" name="7e027929-e86e-41bf-9fc4-636b5f5c3a59" subscription="both" />


Log Entry : 12:36:49 PM Sunday, August 07, 2016
  :
  :OnSendXML: <presence xmlns="jabber:client">
  <status></status>
  <priority>0</priority>
</presence>
-------------------------------

Log Entry : 12:36:52 PM Sunday, August 07, 2016
  :
  :OnSendXML: 
-------------------------------

Log Entry : 12:36:57 PM Sunday, August 07, 2016
  :
  :OnSendXML: 
-------------------------------

Log Entry : 12:37:02 PM Sunday, August 07, 2016
  :
  :OnSendXML: 
-------------------------------

Thanks in Advance
Sanjeev
This post was edited on 2016-08-08, 15:49 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by skhanna:
I have logged all events in log file and try to understand. I have few queries:

(1) Every 5 minutes OnSendXML event is executing. I think due to that because  have set KeepAliveInterval =5. Right? Can I set max    value. Is there any disadvantage if I set max value in KeepAliveInterval.

no, the keep alive interval is in seconds. A value of 5 there is pretty low.

Quote by skhanna:
(2) I did not understand below Stanza on OnSendXML event at the time of login.

you don't have to understand the Xml in the OnReceive and OnSend handlers. MatriX takes care of all of this. They are there only for debugging purposes.
If you want to understand the XMPP protocol in detail then read the RFC 6120 and RFC 6121 from here:
http://www.xmpp.org/extensions/

Alex
Avatar
skhanna #3
Member since Jul 2016 · 73 posts · Location: Indore
Group memberships: Members
Show profile · Link to this post
Hi Alex,

Thanks!!

What is the best max value for KeepAliveInterval?

Sanjeev
Avatar
Alex #4
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
I would recommend 30 - 120 seconds. But you have to find out yourself what works best for your application.
Avatar
skhanna #5
Member since Jul 2016 · 73 posts · Location: Indore
Group memberships: Members
Show profile · Link to this post
If I set to -1 Is it ok ?
Avatar
Alex #6
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by skhanna:
If I set to -1 Is it ok ?

Why are you not looking at the Xml documentation?
It sais:

/// <summary>
/// Gets or sets the keep alive interval.
/// Set -1 to disable keep alives.
/// </summary>
/// <value>The keep alive interval in seconds.</value>
Avatar
skhanna #7
Member since Jul 2016 · 73 posts · Location: Indore
Group memberships: Members
Show profile · Link to this post
Is there any disadvantage, If i set to -1 ?
Avatar
Alex #8
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
yes, your session may get disconnected when no data flows and you may detect connection losses only with delay
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