Recently finished writing an eventing server using async sockets. All I can say is that the performance is nothing less than amazing, it screams. These puppies so efficient, thanks to the io completion port support, that the performance bottleneck is the network interface itself. The NIC actually becomes saturated before we become CPU bound. The largest stress test I've run had around 500 clients all stressing the server at the same time.
The only problem I had along the way was the listener sporadically disposing itself. Luckily, I realized there were a few race conditions. After adding the needed synchronization, the problem went away. I noticed you're using pinning. Why on God's green earth are you doing this!? If you really enjoy pain, and must use pointers, why not just go back and write the whole thing in C++ using IO completion ports? Granted, it'll probably take around 3x longer. Have a good one, John Davis Garry Barclay <[EMAIL PROTECTED]> wrote: 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Ū 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 --------------------------------- 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: 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