Article View: borland.public.cppbuilder.internet.socket
Article #1938Re: TClientSocket OnRead event issues
From: Remy Lebeau (TeamB)
Date: Thu, 14 Sep 2006 17:02
Date: Thu, 14 Sep 2006 17:02
21 lines
1808 bytes
1808 bytes
"Josh Arnold" <jarnold@atterotech.com> wrote in message
news:450949ba$1@newsgroups.borland.com...
Why are you waiting until after calling Open() to assign the event handler?
You should be doing it before instead:
client->OnRead = myClientRead;
client->Open();
> client->Socket->SendText("hello\n");
You are not checking the return value to make sure that the full text is
actually being sent. You are not taking into account that partial text can
be sent, requiring you to re-send the remaining data again. You are also
not taking into account that if a send operation blocks, the send will
report a failure, and you then have to wait until the OnWrite event is
triggered before you can send any further data.
Gambit
Technical Details
Message-ID:
<45098bd2$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.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:
<4508a026@newsgroups.borland.com> <4508a3f3$2@newsgroups.borland.com> <4508aab1$1@newsgroups.borland.com> <4508b143@newsgroups.borland.com> <450949ba$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,6164f1b08fcaf5c2 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: <4508a026@newsgroups.borland.com> <4508a3f3$2@newsgroups.borland.com> <4508aab1$1@newsgroups.borland.com> <4508b143@newsgroups.borland.com> <450949ba$1@newsgroups.borland.com> Subject: Re: TClientSocket OnRead event issues Date: Thu, 14 Sep 2006 10:02:59 -0700 Lines: 23 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: 70.40.40.167 Message-ID: <45098bd2$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1158253522 70.40.40.167 (14 Sep 2006 10:05:22 -0700) Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.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