Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Borland ClientSocket gives memory leak (handle count increases)

Thread Tools

Borland ClientSocket gives memory leak (handle count increases)

Posts: n/a

I have a problem with the clientsocket component in Borland C++
Builder v6.0 - don't know if this is the correct forum. :-S

The clientsocket component is used to connect to a serversocket
component on another PC within my network - it all works fine, as long
as the PC running the serversocket program is running. If I turn the
PC off, the IP address is no longer available, and because I have the
clientsocket connected to a timer, when the connection is lost, the
client tries to connect to the server IP address over and over again.

Whenever the clientsocket then throws an onerror event, I do the

void __fastcall TSyslogForm::ClientSocket1Error(TObject *Sender,
TCustomWinSocket *Socket, TErrorEvent ErrorEvent, int
ErrorCode = 0; //error is being handled


Timer2->Interval = 5000; // 5 sec delay before reconnecting
Timer2->Enabled = TRUE;

However - when the serversocket PC is turned off, the clientsocket
reconnecting over and over again, results in a memory leak where
Windows handles increases until I get an exception like "Windows
socket error: An invalid argument was supplied (10022), on API
'WSACancelASyncRequest'", or "Windows socket error [10055] on API

I haven't been able to find any solution for this problem. The handles
are handled fine, if the serversocket PC is turned on, but without the
serversocket running. Therefore the problem only seems to exists, when
the IP address is unavailable.

Hope to get some help, and thanx in advance!

- Heine.

Reply With Quote
Victor Bazarov
Posts: n/a
Heineken wrote:
> I have a problem with the clientsocket component in Borland C++
> Builder v6.0 - don't know if this is the correct forum. :-S
> [..]

No, it this isn't the correct forum. Try 'borland.public.*'

Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ref count oddness with embedded Python... memory leak? Ben Sizer Python 0 01-11-2007 12:16 PM
QUERY: Borland C++ 4.5 vs Borland Turbo C++ 1.01 C++ 1 10-02-2006 10:57 AM
fprintf(fp,Count); gives C2664 error Joy2006 C++ 2 05-26-2006 05:48 AM
Script that gives instance count unique patterns in a sorted file Generic Usenet Account Perl Misc 9 05-04-2006 08:03 PM
ServerSocket and ClientSocket - bi-directional Abraham Khalil Java 1 01-26-2004 06:03 AM