|
-
May 23rd, 2012, 11:01 AM
#1
Thread Starter
Addicted Member
Networkstream.read/.beginread ,threads and things?
In my own little world were I write small server/client applications, I might only have 5 to 10 clients. I usually create a new thread which handles reading the networkstream or use networkstream.beginread (which I understand basically does the same thing). When the client disconnects or the connection is lost then the thread ends.
Now in the real world the number of clients connected to a server could be hundreds. I dont think my pc could cope with hundreds of threads
So to finally get to the questions, how does the real world handle gettting data from a large quantity of network clients.
I thought about creating a thread to loop through a list of clients and checking to see if data was available. If so creating a thread to read data from that networkstream untill all data was read. once all data was read the thread would end.
Or am I barking mad and up the wrong tree?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|