[MUD-Dev] How many UDP sockets to use?

Michael Montague mikem at tarix.net
Fri Nov 19 08:35:59 CET 2004


Jon Mayo wrote:

> For non real-time data I highly recommend you do one TCP socket
> per player. Things like chat must be delivered. Important actions
> that must be delivered should go over TCP as well. And if timing
> is fairly important, tag the TCP packet with a frame number. For
> example, if you use an item, that "use item" action must be
> delivered. Rather than trying to implement a resend protocol over
> UDP, you can tag your TCP-based message with a synchronized
> timestamp. (this can be as simple as 1+last_server_update_number).

You might want to also look into disabling the nagel algorithm and
possibly expanding this to include two TCP sockets per player.  You
could send time-sensitive guaranteed-delivery information over the
non-nagel connection and chat or other large packets over the
conventional socket.  Before implementing this I would highly
recommend you do some research on the nagel algorithm, what it does,
and why it is enabled by default.

I whole-heartedly agree with not reinventing the networking wheel.
It's always possible that reassembling packets in kernel-space can
be optimized by the OS or driver.  (For example the TCP/IP stack and
underlying network hardware could possible accelerate TCP.  However
it cannot do this for unknown protocols you implement on top of
UDP.)
_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev



More information about the mud-dev-archive mailing list