Article View: borland.public.cppbuilder.internet.socket
Article #629IdTCPServer Exception
From: Joe Pasquariello
Date: Wed, 12 Dec 2007 02:25
Date: Wed, 12 Dec 2007 02:25
18 lines
1616 bytes
1616 bytes
Hello,
I'm just starting with Indy10 on C++ 2007, trying to build a simple TCP
client and server. The Execute() event handler for the server is shown
below. It's trying to simply read a string from the connection and echo it
back to the client. As soon as the client connects to the server, an access
violation occurs in the call of ReadLn(). The error message says "Read of
address 0x0000008C". Can anyone help me past this first hurdle? Thanks.
Joe
void __fastcall TForm1::IdTCPServer1Execute(TIdContext *AContext)
{
AnsiString Text = AContext->Connection->IOHandler->ReadLn();
AContext->Connection->IOHandler->WriteLn( Text );
MessageCountNumLab->Value += 1;
MessageCountNumLab->RightText = Text;
}
Technical Details
Message-ID:
<475f46a6$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!feeder.news-service.com!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 11508e,3fc266b1e1019a25,start X-Google-Attributes: gid11508e,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Joe Pasquariello" <joep@fenway.com> Newsgroups: borland.public.cppbuilder.internet.socket Subject: IdTCPServer Exception Date: Tue, 11 Dec 2007 18:25:44 -0800 Lines: 20 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 NNTP-Posting-Host: 64.142.65.234 Message-ID: <475f46a6$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1197426342 64.142.65.234 (11 Dec 2007 18:25:42 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!feeder.news-service.com!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail