> My question is basically "how?" I've tried to create different threads
> (java.sun KKMultiServer) but this isn't really what I want and I don't
> know how to change it to make it what I want. Does anyone have any
> Ideas, or where I should look for answers?
You seem quite convinced that you don't want different threads. Why?
Any straight-forward Java implementation of the application you describe
would use multiple threads. Before someone invents some kind of trick
to avoid the need for threads, it's probably best if you clarify why you
are trying to avoid them.
Aside from that, your question is quite vague. All I can say is to look
into the API docs for:
java.net.ServerSocket
java.net.Socket
and perhaps:
java.io.DataInputStream
java.io.DataOutputStream

Signature
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
zymosisus - 12 Oct 2005 15:46 GMT
Sorry, I didn't mean to make it sound like I don't want to use
threads. What I ment when I said that it wasn't what I wanted was that
the solution didn't work for me. It allowed me to have multiple
connections, but each connection was handled seperatly. In other words
a different conversation per connection. I couldn't get the same
message to go to each thread.
Thanks,
-Drew
Chris Smith - 12 Oct 2005 21:03 GMT
> Sorry, I didn't mean to make it sound like I don't want to use
> threads. What I ment when I said that it wasn't what I wanted was that
> the solution didn't work for me. It allowed me to have multiple
> connections, but each connection was handled seperatly. In other words
> a different conversation per connection. I couldn't get the same
> message to go to each thread.
You need to handle each connection separately. Whether you arrange for
the same content to be sent over each connection is up to you, but
you'll eventually need to make separate calls to OutputStream or NIO
Buffer objects for EACH of your connections. These objects ultimately
-- at some level of indirection -- handle things like addressing packets
and dealing with buffering and congestion, which will be a unique task
for each client.
So, somewhere in your server application you'll need a list of all
connected clients, and you'll need a loop that walks through each one of
them and arranges to send that message once per client.

Signature
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation