🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #2466

Re: TCPServer Out of memory exception

#2466
From: Justin L Hudson
Date: Mon, 17 Apr 2006 15:14
54 lines
2922 bytes
I am having a similar issue using Borland 5, but I am using the server 
socket.  I can be sending the same data all day long using "SendText" then I 
get a error and wrapping a try and catch around it will not let go of it and 
the program closes?  My assumption at first was that AnsiString in SendText 
was bigger then what I could send?  But I am assumming since SendText 
returns the number of bytes sent I can send up to MaxInt of data?  But 
sometimes SendText will fail on shorter messages?  Any ideas on how to 
determine the root cause of SendText through memory exception?  Could I also 
set a timeout on the server socket?

Thanks,
Justin

"Raffaele Pantaleoni" <pantaraf@yahoo.it> wrote in message 
news:43e71eee$1@newsgroups.borland.com...
> Hi to all,
> I'm working with:
> BCB 6 Enterprise (updated)
> Windows XP Professional SP2 / Windows 2000 Professional
> Indy 9.
>
> I wrote two applications, a client and a server using Indy TCPClient and
> TCPServer.
>
> During runtime I got on the Server OnExecute event an "Out of memory"
> exception while trying to do a ReadLn, code follows.
>
> void __fastcall TForm1::tcpServerExecute(TIdPeerThread *AThread)
> {
>  AnsiString Msg;
>  //Get the text sent from the client
>  try
>  {
>    Msg=AThread->Connection->ReadLn("",5);
>  }
>  catch (Exception &exception)
>  {
>    ExceptionsLog("tcpServerExecute",exception.Message);
>  }
> }
>
> From time to time this error pops up. It takes several hours to come
> out, more than six hours. Moreover it seems to come out when the channel
> is idle (no communications between the client and the server).
> The system memory is still avalaible when the error come out, and the
> process itself hasn't growth in memory size.
>
> All the tests were made on the same pc (address 127.0.0.1). The error
> comes out either if I connect a telnet to my server or my client
> application or both of them at the same time.
>
> Any idea?
> Thank you
> Raffaele Pantaleoni 
Technical Details
Message-ID: <4443b0bc$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <43e71eee$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,bcfef8d7a8434913
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Justin L Hudson" <justin.hudson@bepco.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <43e71eee$1@newsgroups.borland.com>
Subject: Re: TCPServer Out of memory exception
Date: Mon, 17 Apr 2006 11:14:03 -0400
Lines: 56
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 70.225.107.130
Message-ID: <4443b0bc$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1145286844 70.225.107.130 (17 Apr 2006 08:14:04 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail