Here my general road map.... for multithreaded chat program
(client/server):
Client sends users name, server responds with SecretKey, then users
send the encrypted password. Server responds with ConnectionObject to
indicate the status. All the communication between client and server is
encrypted thereafter.
it is pretty simple program, and I am thinking of using NIO .. What is
the good architecture for such problem?
what is de facto way to approach the design. Thanks
> Client sends users name, server responds with SecretKey, then users
> send the encrypted password. Server responds with ConnectionObject to
> indicate the status. All the communication between client and server is
> encrypted thereafter.
The server responds by sending a secret key in the clear?
I suggest using existing procedures/protocols/standards/code. See
javax.net.ssl, for instance.
> it is pretty simple program, and I am thinking of using NIO .. What is
> the good architecture for such problem?
I guess start by googling "reactor pattern".
Admittedly, I don't have a copy of this volume, or have even read it,
but "Pattern-oriented Software Architecture Vol 2: Patterns for
Concurrent and Networked Objects" seems to fit:
http://www.amazon.co.uk/gp/product/0471606952/
Tom Hawtin

Signature
Unemployed English Java programmer
http://jroller.com/page/tackline/