Siddhant Sood

Greenhorn
+ Follow
since Apr 05, 2015
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Siddhant Sood

Henry Wong wrote:

Well, technically, this is not a "requirement". You can use the NIO library to have a single thread check/select from many channels simultaneously.

Henry




I am new to Java and not much aware of NIO library.

Thanks for your inputs and correcting me
8 years ago

Ilya Puzanov wrote:

And also, how many threads is ok to use for chat client/server? My server already have 3 threads and i still need more for login information checking at least.



For client/server chat one user thread is required per client, so that while the server is waiting(blocked) for the incoming client requests the already connected clients can be serviced concurrently by the individual threads.

We can make use of Thread pool instead of creating a new thread for each new client, this saves time giving better performance as threads can be re-used.
8 years ago