Architecture of a Chat

ive written a little chat system, but would like to discuss the organisation.
the chat is serverbased. all clients have to connect to the server via tcp/ip and then they get an overview about the other clients (but no direct connection). so all actions (color changes etc) and messages are first sent to the server and then directed to the other clients.

the messages are concatenated with a command, e.g.:

change_color||red
say||greetings!

and cut into command - operation via stringtokenizer.

so my questions:
the work for my server is very hard, he has to accept EVERY action. situations like one client doesnt want to hear another is handled with a filter system by the server,
so he gets messages, which are perhaps obsolete.

is this the normal chat-architecture ?
or should i code only a server which arranges the direct-connections between the clients, so if a clients logs into the network it gets all ips from the other clients for connection ?

There are many possibilities depending on the needs and scale of that thing.

ICQ-like chats cannot be handled by a server bc. there are millions of users. But the ‘filter’ states that each user only talks to a verylimited number of other. So a client-client connection is feasable.

For a all-vs-all scenario, the server is a must, bc. a single client cannot open and maintain thousands of connections.
Depending on the expected use of filters, you could think of client-side filtering to release the server from that load.

[quote]ive written a little chat system, but would like to discuss the organisation.
[/quote]
One question: why aren’t you using IRC?

I assume you wanted to learn about networking as you went along, or something…If so, the best bet now is to look at IRC in detail and compare and contrast. My initial reaction is to wonder why you care about efficiency of messages - are you having problems with performance? If not, why worry?

If you look at IRC you’ll see how they solved the problems, and if it works, and whether users complain about the way they chose to do it.

ohh yes, indeed it is very important to know, that my chat is only for learning purposes. so i want to get the problems and
to think about them critically.
my goal is not create a water-proof system, more interesting are questions which ask for the “why” of the solutions.

but perhaps it is not a too bad idea to look into irc …