processone / rtb

Benchmarking tool to stress real-time protocols
https://www.process-one.net/
Apache License 2.0
50 stars 7 forks source link

Respond to server pings with a pong #4

Closed gardenia closed 6 years ago

gardenia commented 6 years ago

if server is configured to send (server to client) pings then respond with a pong

zinid commented 6 years ago

Actually replying with IQ error is enough for the server to learn that the client connection is alive, why do we need special processing of iq pings? Can you clarify please, because this requires more code than probably needed.

gardenia commented 6 years ago

my main motivation was that the the client (rtb) gets a lot of verbose output about the unhandled IQ request and it was obscuring other things of interest in the output (see below).

if you think it is not legitimate to trap / respond to the ping then fair enough. I just find it useful in my case.

12:05:34.416 [warning] Unsupported IQ request:
#iq{id = <<"10777045712281767860">>,type = get,lang = <<>>,
    from = #jid{user = <<>>,server = <<"xmpp.mysite.com">>,resource = <<>>,
                luser = <<>>,lserver = <<"xmpp.mysite.com">>,
                lresource = <<>>},
    to = #jid{user = <<"user46_at_loadtest.com">>,
              server = <<"xmpp.mysite.com">>,resource = <<"rtb">>,
              luser = <<"user46_at_loadtest.com">>,
              lserver = <<"xmpp.mysite.com">>,lresource = <<"rtb">>},
    sub_els = [#xmlel{name = <<"ping">>,
                      attrs = [{<<"xmlns">>,<<"urn:xmpp:ping">>}],
                      children = []}],
    meta = #{}}
zinid commented 6 years ago

Ah, right, ok, I merge then.