🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TClientSocket OnRead event issues

#1903
From: Arnoud
Date: Tue, 26 Sep 2006 13:57
28 lines
2199 bytes
Josh Arnold schreef:
> Problem solved for now,
> 
> It appears that the client socket needs a "garbage read" in order to get the
> OnRead event working.
> Since the OnConnect event fires I just stuck in a
> socket->RecieveText() and now the responses from the server are heard.
> 
> Thanks for the help, don't know if this qualifies as a bug or not?
> 
> -Josh

Hi Josh,

I got a similar problem in my communications with a embedded tcp/ip 
stack, i addded your 'garbage read' idea and it worked for me as well.

OnRead() seems to trigger only *once*, and then expect our applications 
to do at least one Read operation to trigger again. Our applications 
probably did not expect to read data before OnConnect. The 'garbage 
read' probably reset the flag so OnRead() fired again.

Did you use any other components inside your application?
I have used a NMUDP(fastnet) component to handle someUDP traffic.

Thank you for sharing the idea!

-Arnoud
Technical Details
Message-ID: <4519327b@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news1.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.cw.net!cw.net!news-FFM2.ecrc.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4508a026@newsgroups.borland.com> <4508a3f3$2@newsgroups.borland.com> <4508aab1$1@newsgroups.borland.com> <4508b143@newsgroups.borland.com> <450949ba$1@newsgroups.borland.com> <45095b16@newsgroups.borland.com> <45096c00@newsgroups.borland.com> <45098f13@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
Date: Tue, 26 Sep 2006 15:57:50 +0200
From: Arnoud <vult-r@endless-online.com>
User-Agent: Thunderbird 1.5.0.7 (Windows/20060909)
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: Re: TClientSocket OnRead event issues
References: <4508a026@newsgroups.borland.com> <4508a3f3$2@newsgroups.borland.com> <4508aab1$1@newsgroups.borland.com> <4508b143@newsgroups.borland.com> <450949ba$1@newsgroups.borland.com> <45095b16@newsgroups.borland.com> <45096c00@newsgroups.borland.com> <45098f13@newsgroups.borland.com>
In-Reply-To: <45098f13@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 213.84.81.135
Message-ID: <4519327b@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1159279227 213.84.81.135 (26 Sep 2006 07:00:27 -0700)
Lines: 28
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news1.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.cw.net!cw.net!news-FFM2.ecrc.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail