Article View: borland.public.cppbuilder.internet.socket
Article #4401Re: (code) Re: Error on reconnection to server
From: Ben
Date: Tue, 22 Feb 2005 15:13
Date: Tue, 22 Feb 2005 15:13
57 lines
3175 bytes
3175 bytes
Hi Hans! I'm sorry it took some time to test your advice. The Sleeps were causing the problems you were completely right. I followed your advice and start a timer on client->disconnect trying to reconnect every 5 seconds. This works fine. Thanks for your help! Ben Hans Galema wrote: > Ben wrote: > >> I am using this part exactly the same way as the Borland chat sample. > > > That is hard to believe as the chat example only uses > SendText()/ReceiveText() and not SendBuf()/ReceiveBuf(). > You can use it as a start, but as soon as you have a connection > you have to better the code. In your own interest add the > suggested checks. > >> And when reconnected, socket->active is true, there is no >> reconnection, i.e. the server is still listening. > > > Sorry but I do not understand above sentence. > >> When there is e valid reconnection everything works fine. > > > You are trying to reconnect in that thread. Using a terible Slep(). > I do not see that you use the OnDisConnect event. Try to use that > event to reconnect again. But not immediately. Start a timer and > in the timer event try to set Activbe to true. > >> BTW, the message is always available, with or without valid data. Any >> way data is not changed when sent, inpointer != outpointer of buffer. > > > ???????????? > >> The SocketSend function is executed when an acknowledge has been >> received. > > > That is no answer to my question as you did not tell where how an > acknowledgement is received. Repeat: Where and when do you call > TCPClientSocketSend() ? > >> I hope this gives you enough information to give a clou. > > > Please add the checks and try OnDisConnect and so. > > Hans.
Technical Details
Message-ID:
<421b4c29$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!feeder2.on.meganewsservers.com!meganewsservers.com!textfeed1.on.meganewsservers.com!38.119.100.83.MISMATCH!news-out.nntp.be!propagator2-sterling.newsfeeds.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<4208d668$1@newsgroups.borland.com> <4208fa07$1@newsgroups.borland.com> <4209bc24$1@newsgroups.borland.com> <42105bd0$1@newsgroups.borland.com> <4210767f$1@newsgroups.borland.com> <4211e9a4$1@newsgroups.borland.com> <4211f823@newsgroups.borland.com> <42120c10@newsgroups.borland.com> <421223ed@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,7304809fda7b8b4e X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Tue, 22 Feb 2005 16:13:47 +0100 From: Ben <TerNOra@etraSPAMde.nl> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.internet.socket Subject: Re: (code) Re: Error on reconnection to server References: <4208d668$1@newsgroups.borland.com> <4208fa07$1@newsgroups.borland.com> <4209bc24$1@newsgroups.borland.com> <42105bd0$1@newsgroups.borland.com> <4210767f$1@newsgroups.borland.com> <4211e9a4$1@newsgroups.borland.com> <4211f823@newsgroups.borland.com> <42120c10@newsgroups.borland.com> <421223ed@newsgroups.borland.com> In-Reply-To: <421223ed@newsgroups.borland.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 80.126.94.138 Message-ID: <421b4c29$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1109085225 80.126.94.138 (22 Feb 2005 07:13:45 -0800) Lines: 57 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!feeder2.on.meganewsservers.com!meganewsservers.com!textfeed1.on.meganewsservers.com!38.119.100.83.MISMATCH!news-out.nntp.be!propagator2-sterling.newsfeeds.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail