[Home] [Groups] - Message: [Prev in Group] [Next in Group]
4933: Re: [MUD-Dev] World Persistence, flat files v/s DB v/s ??
[Full Header] [Plain Text]
From: Joel Dillon <emily@cornholio.new.ox.ac.uk>
Newsgroups: nu.kanga.list.mud-dev
Date: Sun, 22 Mar 1998 13:03:00 +0000 (GMT)
References: [1]
Organization: Kanga.Nu
> You're going to need one ServerSocket per player, aren't you?
>
> If I am correct in this assumption, there is no problem - you can use one
> thread to read from them, identifying connections by the socket they are
> connected to.
The problem here is that you can't do nonblocking i/o in Java. So
while you were waiting for input from 1 player the others would all be
blocked ;)
> If not, you can either use one thread/socket, and require a custom client,
> which attaches an identifier to data sent (possibly using something like
> DataGramPacket, where one part of the packet is the identifier), or just
> use one thread per player - this doesn't seem overly excessive to me. :)
Exactly. Threads are a lot cheaper than processes ;)
Jo