The client calls are made from a ThreadPool thread (initiated by
QueueUserWorkItem).

Just to be clear - are you saying that a thread which initiates BeginSend
successfully (i.e. no exceptions and CompletedSynchronously == false) must
not terminate until the EndSend is received? Surely the EndSend will be
returned on a ThreadPool (completion) thread?

>Any chance the thread that initiated the BeginSend is ending before the
>callback is received?  This can happen if you're using a home-grown
>thread pool.  The system ThreadPool has special logic to ensure a thread
>is never destroyed if there are pending IOCP requests.
>
>Rick
>
>-----Original Message-----
>From: Unmoderated discussion of advanced .NET topics.
>[mailto:[EMAIL PROTECTED] On Behalf Of Garry Barclay
>Sent: Wednesday, July 21, 2004 5:10 AM
>To: [EMAIL PROTECTED]
>Subject: [ADVANCED-DOTNET] Missing callbacks from asynchronous sockets?
>
>It appears that we are NOT receiving the (completion port) callback from
>an asynchronous socket (BeginSend/EndSend) call.
>
>The sockets are clients and the failure seems to be related to shutdowns
>on the socket.
>
>This has the effect of leaving a pinned GCHandle on the heap (pinning
>the
>send buffer). We've checked the process memory dump with WinDbg and have
>seen that the sockets are shutdown successfully. Checking the Socket
>class
>implementation (v1.1) with Reflector it's seems clear that IF the
>callback
>is made then the buffer should always be unpinned.
>
>We've added in static counters using interlocked.xxx to verify that the
>calls are definitely not reaching our code, and this confirms our
>suspicions.
>
>Because of the pinned buffers, heap compaction can't take place and we
>end
>up with high memory usage figures even though most of the heap is free
>space between those buffers.
>
>Anyone seen something like this before?
>
>===================================
>This list is hosted by DevelopMentor(r)  http://www.develop.com
>Some .NET courses you may be interested in:
>
>NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
>http://www.develop.com/courses/gaspdotnetls
>
>View archives and manage your subscription(s) at
>http://discuss.develop.com
>
>===================================
>This list is hosted by DevelopMentorŪ  http://www.develop.com
>Some .NET courses you may be interested in:
>
>NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
>http://www.develop.com/courses/gaspdotnetls
>
>View archives and manage your subscription(s) at
http://discuss.develop.com

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to