[MUD-Dev] UDP Revisted

Kwon Ekstrom justice at softhome.net
Sat Oct 13 16:55:20 CEST 2001


From: "Bobby Martin" <bobbymartin at hotmail.com>

> Can you give me some references on why you think a reliable
> transport layer on top of UDP would perform better than TCP?  I am
> running an open source java project (ARMI) that I originally
> intended to use UDP.  I had some ideas of what I would do to make
> transport reliable, then when I investigated TCP it appears to do
> pretty much exactly what I had planned, with some improvements.

> There are only two real reasons I'm seeing now to use UDP instead
> of TCP for java:

>   1) TCP 'plays nice', not congesting connections by hogging
>   bandwidth

>   2) TCP requires one thread per client in Java.  There are some
>   workarounds, but they perform very, very abysmally.

http://www.cs.berkeley.edu/~mdw/proj/java-nbio/

Here's some work on NBIO for java, also I've done my own
non-blocking using the standardized objects, but can't detect a
disconnect until data is sent down the line.  I'm using a
combination timeout/data disconnect.  It works well enough for what
I'm doing for now.  I intend to update after 1.4 is released to
channels.

> 2) is a big problem, since one of the things for which I'm using
> ARMI is a MMORPG.  Java 1.4 appears to address the problem with
> java.nio.channels, though, and I can limp along between now and
> then with either regular java TCP Sockets or with a JNI
> implementation that delegates to a C/C++ TCP sockets library.

*nod* The 1.4 nio package is based on the work in the link above
(which will deprecate after 1.4 is released)

-- Kwon Ekstrom

_______________________________________________
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