Click here to Skip to main content
15,923,389 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralPostMessage question... Pin
rmnowick23-Mar-04 15:16
rmnowick23-Mar-04 15:16 
GeneralRe: PostMessage question... Pin
Antony M Kancidrowski24-Mar-04 0:32
Antony M Kancidrowski24-Mar-04 0:32 
GeneralRe: PostMessage question... Pin
rmnowick24-Mar-04 8:25
rmnowick24-Mar-04 8:25 
GeneralRe: PostMessage question... Pin
Roger Allen24-Mar-04 2:07
Roger Allen24-Mar-04 2:07 
Generalservice status Pin
Irish_GUI23-Mar-04 14:23
Irish_GUI23-Mar-04 14:23 
GeneralRe: service status Pin
Maksim Lepikhin23-Mar-04 15:22
Maksim Lepikhin23-Mar-04 15:22 
GeneralRe: service status Pin
Arcrest23-Mar-04 17:00
Arcrest23-Mar-04 17:00 
GeneralHandle Leak : HKLM\SYSTEM\ControlSet001\Services\DnsCache\Parameters Pin
cmk23-Mar-04 13:03
cmk23-Mar-04 13:03 
I have a simple server that seems to be leaking handles.

The handle is to a registry key :
HKLM\SYSTEM\ControlSet001\Services\DnsCache\Parameters

In particular 1 handle (key) to this is leaked for each client connection.

The service is simple, it calls socket(AF_INET, SOCK_STREAM, IPPROTO_TCP), bind(), listen() then waits in a loop on accept().

Each accept() creates a thread that handles the connection.
All the thread does is some predefined sync send() and recv() calls then exits.

Everything is being closed correctly, thread, socket, ...
But each closed connection leaves another one of these handles around.
The handles don't appear to be cached, as i have tried leaving the service running with no conncetions for hours to see if they get 'cleaned up' - no joy.

Short of disabling the DNS Client service, does anyone have any ideas ?

[EDIT]
The handle is being created by SQLConnectA().
[/EDIT]

[EDIT_2]
I'm able to get rid of the leak by enabling connection pooling via :
::SQLSetEnvAttr(NULL, SQL_ATTR_CONNECTION_POOLING, (void*)SQL_CP_ONE_PER_DRIVER, 0);
[/EDIT_2]


...cmk

Save the whales - collect the whole set
GeneralA question about reading non-data CDs Pin
Roger Wright23-Mar-04 12:20
professionalRoger Wright23-Mar-04 12:20 
GeneralRe: A question about reading non-data CDs Pin
Shog923-Mar-04 19:56
sitebuilderShog923-Mar-04 19:56 
GeneralRe: A question about reading non-data CDs Pin
Roger Wright23-Mar-04 20:52
professionalRoger Wright23-Mar-04 20:52 
GeneralRe: A question about reading non-data CDs Pin
Ceri24-Mar-04 2:54
Ceri24-Mar-04 2:54 
GeneralRe: A question about reading non-data CDs Pin
Roger Wright24-Mar-04 4:39
professionalRoger Wright24-Mar-04 4:39 
GeneralGetting a window to come forward on XP Pin
Tom Wright23-Mar-04 12:01
Tom Wright23-Mar-04 12:01 
GeneralRe: Getting a window to come forward on XP Pin
Antony M Kancidrowski23-Mar-04 12:38
Antony M Kancidrowski23-Mar-04 12:38 
GeneralRe: Getting a window to come forward on XP Pin
Christian Graus23-Mar-04 16:18
protectorChristian Graus23-Mar-04 16:18 
GeneralRe: Getting a window to come forward on XP Pin
Mike Dimmick24-Mar-04 2:59
Mike Dimmick24-Mar-04 2:59 
GeneralRe: Getting a window to come forward on XP Pin
Tom Wright24-Mar-04 5:56
Tom Wright24-Mar-04 5:56 
GeneralCListCtrl - Sort Pin
jcplatt23-Mar-04 11:59
jcplatt23-Mar-04 11:59 
GeneralRe: CListCtrl - Sort Pin
David Crow24-Mar-04 2:08
David Crow24-Mar-04 2:08 
GeneralRe: CListCtrl - Sort Pin
jcplatt25-Mar-04 8:46
jcplatt25-Mar-04 8:46 
GeneralCan't write to HKEY_CURRENT_USER when impersonating (new problem) Pin
ICantChangeMyAcct23-Mar-04 10:02
ICantChangeMyAcct23-Mar-04 10:02 
GeneralRe: Can't write to HKEY_CURRENT_USER when impersonating (new problem) Pin
David Crow23-Mar-04 10:29
David Crow23-Mar-04 10:29 
GeneralRe: Can't write to HKEY_CURRENT_USER when impersonating (new problem) Pin
ICantChangeMyAcct23-Mar-04 11:06
ICantChangeMyAcct23-Mar-04 11:06 
GeneralPrevent to open program multiplie times Pin
Snillet2k23-Mar-04 9:52
Snillet2k23-Mar-04 9:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.