« January 2007 | February 2007 Archives | March 2007 »

Socket Server code: AcceptEx server memory leak

| 6 Comments
The latest version of The Server Framework contains a memory leak in the CSocketServerEx class. It's quite a good leak, it leaks an IO buffer on every connection attempt. The fix is as follows: Change this code: void CStreamSocketServerEx::PostAcceptRequest() { if (m_listeningSocket != INVALID_SOCKET) { if (m_connectionLimiter.CanCreateConnection()) { IncrementPendingReceives(); const IFullAddress &address = GetAddress(); IStreamSocketEx *pSocket = AllocateSocket(CreateSocket(address.Type())).Detach(); IBuffer *pBuffer = AllocateBuffer(); pBuffer->SetUserPtr(m_socketIndex, pSocket); PostIoOperation(pBuffer, IO_Accept_Request); } else to this: void CStreamSocketServerEx::PostAcceptRequest() { if (m_listeningSocket != INVALID_SOCKET) { if (m_connectionLimiter.CanCreateConnection()) { IncrementPendingReceives(); const IFullAddress &address = GetAddress(); IStreamSocketEx *pSocket = AllocateSocket(CreateSocket(address.Type())).Detach(); CSmartBuffer buffer(AllocateBuffer()); buffer.Get()->SetUserPtr(m_socketIndex, pSocket); PostIoOperation(buffer.Get(), IO_Accept_Request); } else…

Some interesting stuff from Katie Lucas

| 0 Comments
Here are a few interesting views on software development from Katie Lucas. Via Joel on Software. I especially enjoyed the design methodologies, becoming a manager and "remove developers net access" pieces.…

Crapness in mscoree.h

| 0 Comments
I'm playing around with hosting the CLR in C++ at present and have come across a bit of crapness in the mscoree.h file... #if (_MSC_VER < 1300 || _WIN32_WINNT < 0x0500) typedef VOID ( __stdcall *WAITORTIMERCALLBACK )( PVOID __MIDL_0011, BOOL __MIDL_0012); #endif // (_MSC_VER < 1300 || _WIN32_WINNT < 0x0500)…

Lifetime management issues with CLR hosting

| 0 Comments
I'm still playing with hosting the CLR in C++ (using "Customizing the Microsoft.NET Framework Common Language Runtime" by Steven Pratschner as my guide)... It's an interesting journey but, once again, I wonder who makes the important technical decisions at Microsoft and how they sleep at night ;) .…

Dino Viehland on CLR hosting

| 0 Comments
This is mainly a reminder for me so that I can read this when I get back from Jackson Hole... Dino Viehland has written some interesting looking blog posts on how to implement the thread/task and syncrhonisation host managers for a hosted CLR. Note that this is all "Whidbey beta 1" stuff so, well, your milage may vary...…

Software failures...

| 0 Comments
I'm in Jackson Hole right now, my skis are still in Denver... Although they've replaced the baggage handling system at Denver International Airport since the days of the classic software project failure, it seems that the current system could still need some work ;) Hopefull I'll see my skis later today...…
« January 2007 | February 2007 Archives | March 2007 »

About this Archive

This page is an archive of entries from February 2007 listed from newest to oldest.

January 2007 is the previous archive.

March 2007 is the next archive.

I usually write about C++ development on Windows platforms, but I often ramble on about other less technical stuff...

Find recent content on the main index or look in the archives to find all content.

I have other blogs...

Subscribe to feed The Server Framework - high performance server development
Subscribe to feed Lock Explorer - deadlock detection and multi-threaded performance tools
Subscribe to feed l'Hexapod - embedded electronics and robotics
Subscribe to feed MegèveSki - skiing