/* send noop if we haven't sent anything to this client for
* 3 minutes */
if (TICK_DIFF(gtc, cli->lastsendtime) > 18000)
sp_send(cli, "NOOP"); |
The only place cli->lastsendtime gets modified is when the player connects and gets created or in do_sp_write() which gets called when something is sent s2c.
int do_sp_write(sp_conn *conn)
{
Link *l = LLGetHead(&conn->outbufs);
if (l && l->data)
{
...
conn->lastsendtime = current_ticks();
}
return 0;
} |
Grelminar - Wed Jul 27, 2005 3:43 am
Post subject:
Yes, that looks correct. The server will send a NOOP every three minutes, if no other traffic has been sent. It's not configurable, although it wouldn't be hard to make it configurable, if there's a good reason for it.
Now that I think about it, it should reset the timer (not "lastsendtime", but use another timer) for any c2s traffic as well, since this being tcp, c2s traffic implies packets flowing s2c also. The point is just to hack around broken NAT devices, so any packets at all are sufficient.