When using .Net asynchronous sockets, which thread are callbacks called from?

88 Views Asked by At

When you use asynchronous methods like Socket.BeginConnect and Socket.BeginReceive you pass an AsyncCallback delegate.

When these delegates are called, are they called from one of the internal thread-pool threads, or a temporary thread? I was thinking for instance in the case you are running a server, if you start doing logic in your callback implementation and don't return, will you exhaust the threadpool after a few connections are accepted since you are 'stealing' the thread?

0

There are 0 best solutions below