Results 1 to 1 of 1
- 11-19-2011, 02:59 PM #1Member
- Join Date
- Jun 2011
- Rep Power
NIO Help - Dividing clients on different threads
I'm currently working on a free time project witch basically accepts connections.
As we know with NIO, you can use one thread to listen to many different connections using Selector.
I've followed this guide on how to make a non-blocking server + client (Rox Java NIO Tutorial).
My problem is that when accepting connections on a Selector, it is directly assigned to the selector instead of being
able to put it into a selector by myself.
What I want to accomplish is lets say I have 100 clients connected, and I want to split them all up into 10 clients per thread.
So 1 Selector, 10 clients. But reading the NIO documentation on Java, I have to say it's rather vague on both functions within
the NIO API, and how it works.
Anyone have experience using non-blocking sockets? Any other good tutorials? Or an idea on how I could implement what I just described?
- By koneru_18 in forum New To JavaReplies: 1Last Post: 06-28-2011, 09:19 PM
- By poop in forum New To JavaReplies: 4Last Post: 05-30-2011, 07:56 AM
- By hawaiifiver in forum New To JavaReplies: 19Last Post: 03-11-2011, 11:09 AM
- By Quizzle23 in forum New To JavaReplies: 18Last Post: 02-24-2011, 06:42 AM
- By sadishm in forum NetworkingReplies: 1Last Post: 10-25-2010, 11:21 PM