Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
2
Reply
async reading using beginread
Don Kooker
Apr 6 2008 1:16 AM
7.6k
Reply
A few questions as to how beginread on a tcpclient or socket. If I start beginread, I believe the thread comes from the thread pool. Does the thread start when beginread is called, when data starts arriving, or when the specified number of bytes are recd and the ascyn callback method is started? The reason I ask, is I am wondering if I have a large number of connections reading and the clients that are sending data are slow (or not at all), will the thread pool quicklty fill up with threads that aren't doing anything waiting on data to be recd from clients?
The other related question I have is related to how to cleanly shutdown if there are async reads going on. Can you just close the tcpclient down from the main thread and the async readers go away gracefully, or do you have to do some sort of explicit locking on something like the tcpclient itself?
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
Sharing a Generic Collection
Design help needed: Requirement to process huge number of data efficientlty