Borland ClientSocket gives memory leak (handle count increases)



 DEVELOP > c-Plus-Plus > Borland ClientSocket gives memory leak (handle count increases)

LINK TO THIS PAGE  


rating :  0   |  0


  Page 1 of 1

1

 
Topic: DEVELOP > c-Plus-Plus
User: "Heineken"
Date: 02 Aug 2007 08:44:48 AM
Object: Borland ClientSocket gives memory leak (handle count increases)
Hi,
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
following:
void __fastcall TSyslogForm::ClientSocket1Error(TObject *Sender,
TCustomWinSocket *Socket, TErrorEvent ErrorEvent, int
&ErrorCode)
{
ErrorCode = 0; //error is being handled
Socket->Close();
ClientSocket1->Close();
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
connect".
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.
.

User: "Victor Bazarov"

Title: Re: Borland ClientSocket gives memory leak (handle count increases) 02 Aug 2007 09:04:38 AM
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.*'
hierarchy.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
.


  Page 1 of 1

1

 


Related Articles
 

NEWER

pg.1232     pg.940     pg.716     pg.544     pg.412     pg.311     pg.234     pg.175     pg.130     pg.96     pg.70     pg.50     pg.35     pg.24     pg.16     pg.10     pg.6     pg.3     pg.1

OLDER