[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

PING/PONG



Hi,

irc clients may want to know whether the server they are connected to is
still there/alive (as the server wants to know too).

They have several ways for doing this. One of them is to send a bogus
command and then wait for the server reply which contains the supplied
arguments. This way, one can make sure that such a server reply
corresponds to a connection test from the client (since the server gives
you back the same arguments as you gave him).

But this is a rather ugly way of doing it. If you want to be kind to the
server, there has always been (until it got changed in 2.9 or 2.10)
another way of doing it, which didn´t force the client to send a bogus
command to the server. The client could just send a PING with one or more
arguments to the server and then wait for the PONG from the server which
_contained the same arguments as the client supplied to it_.

The behavior of the server returning the arguments from a received PING in
its PONG has been this way the last 10 years or so (as i´ve been told).
And it´s still like this on most major irc.nets out there, except (of
course) on IRCNet. The IRCNet ircd just returns "PONG :<nick of the
originating client of the PING>" instead of "PONG :<args supplied from the
originating client of the PING>".

This different behavior hinders the client from being kind to the server.

Some say returning the arguments of the PING within the PONG would violate
the RFC. This is not true. The RFC says:

  Any client which receives a PING message must respond to <server1>
  (server which sent the PING message out) as quickly as possible with
  an appropriate PONG message to indicate it is still there and alive.

"appropriate" is not defined! Which means you can define it any way you
want. Returning the arguments within the PONG message would be completely
within the proctol.

It would make all our lifes a lot easier if the server wouldn´t fight the
client. Instead of fighting it, it should work together with it.

If you´re worried about the procotol length, then you can just cut the
PONG at something reasonable like 80 characters.

So why not take the easy way and let the client use PING :<args> instead
of some bogus command and then give it back the <args> in the
corresponding PONG?

It´s much cheaper to return a PING to PONG instead of having to do a
procotol command miss.

Or is there another way of asking the server whether it´s still alive and
then get back a unique ID from it which the client sent to it?

If not, then please get the server back to the traditionnal behavior.

Thanks, Kasi

-- 
Kaspar Landsberg, <kl@xxxxxxxxxxx>