Tuesday 15 March 2011

java - Running multiple clients from a single class in a chat server program -



java - Running multiple clients from a single class in a chat server program -

i have designed server programme , client programme simple java chat-server. chat server runs , clients can pass messages each other through server.

however, having create multiple copies of same client class , number these classes client1, client2, client3, ... (i.e. in different names) in order server take connection each of these client classes.

my question this: somehow possible create many client connections want using single client class running on computer?

you not need different classes. think need either run clients in different processes, i.e. start same main class multiple times, or run in multiple threads.

java

No comments:

Post a Comment