John, I'm just showing it this way to make the point that there is a framework bug. Our original code does call EndSend within a callback (but the callback sometimes doesn't come in). I've just shown it like this to take our own code out of the equation.
But for the sake of anyone reading this thread, the EndSend calls WaitOne (via InternalWaitForCompletion on LazyAsyncResult) on the internal Event for you. What makes you think EndSend will not work in this form? Garry On Wed, 4 Aug 2004 19:29:46 -0700, John Davis <[EMAIL PROTECTED]> wrote: >Do a WaitOne on the WaitHandle in the IAsyncResult, returned from BeginSend, before calling EndSend. Or pass a callback to the BeginSend, and then call EndSend within the callback. A lot of the current socket documentation is just plain wrong. I reported it a couple weeks ago, and got a response the other day saying that it has been updated. > >Garry Barclay <[EMAIL PROTECTED]> wrote:I'm still struggling to make a small demo (it's definitely a timing thing >and it appears most readily on a dual-processor machine running server >GC), but the current version of the program works when we send using the >following line of code: > >return m_socket.Send(buffer, offset, size, socketFlags); > >and fails with the replacement: > >return m_socket.EndSend(m_socket.BeginSend(buffer, offset, size, >socketFlags, null, null)); > >In this case we lose a thread as well as a pinned handle every time it >occurs. This has to be a framework bug. > >=================================== >This list is hosted by DevelopMentorŪ http://www.develop.com >Some .NET courses you may be interested in: > > >>>> Error in line 15 of ADVANCED-DOTNET.MAILTPL: unknown formatting command <<< >-> .NET Architecture and Design: Designing Distributed Applications with <- > > > >--------------------------------- >Do you Yahoo!? >Yahoo! Mail is new and improved - Check it out! > >=================================== >This list is hosted by DevelopMentorŪ http://www.develop.com >Some .NET courses you may be interested in: > >Essential .NET: building applications and components with CSharp >August 30 - September 3, in Los Angeles >http://www.develop.com/courses/edotnet > >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: Essential .NET: building applications and components with CSharp August 30 - September 3, in Los Angeles http://www.develop.com/courses/edotnet View archives and manage your subscription(s) at http://discuss.develop.com