Article View: borland.public.cppbuilder.internet.socket
Article #2469Re: TCPServer Out of memory exception
From: Remy Lebeau (TeamB)
Date: Mon, 17 Apr 2006 17:17
Date: Mon, 17 Apr 2006 17:17
44 lines
2661 bytes
2661 bytes
"Justin L Hudson" <justin.hudson@bepco.com> wrote in message news:4443b0bc$1@newsgroups.borland.com... > 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" SendText() is not an Indy method. You cannot possibly be having a similar issue that Raffaele was having using Indy. > I get a error and wrapping a try and catch around it will not let go of > it and the program closes? That is highly unlikely. Unless you are trying to catch a specific type of exception that is not actually being thrown, and not catching the real one that really is. Please show your actual code. > My assumption at first was that AnsiString in SendText was bigger > then what I could send? That assuption is wrong. SendText() simply ignores whatever it cannot accept, and returns a numeric value specifying how much it actually did accept. It is your responsibility to check that return value and then re-call SendText() again if any of the string data was not accepted by the socket. > But I am assumming since SendText returns the number of bytes > sent I can send up to MaxInt of data? The socket will never allow that much data to be sent in a single operation. That is way too much data for it to handle. By default, the internal buffers will only allow approx. 8Kb at a time. I have also seen cases where the socket decided the application was trying to send too much data in general and it would return an WSAENOBUFS error and fail altogether. > Any ideas on how to determine the root cause of SendText through > memory exception? There is no way to diagnose that without more details. Gambit
Technical Details
Message-ID:
<4443cdb5$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<43e71eee$1@newsgroups.borland.com> <4443b0bc$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: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.internet.socket References: <43e71eee$1@newsgroups.borland.com> <4443b0bc$1@newsgroups.borland.com> Subject: Re: TCPServer Out of memory exception Date: Mon, 17 Apr 2006 10:17:08 -0700 Lines: 46 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <4443cdb5$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1145294261 68.69.17.41 (17 Apr 2006 10:17:41 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail