Article View: borland.public.cppbuilder.internet.socket
Article #4360Re: (code) Re: Error on reconnection to server
From: Hans Galema
Date: Tue, 15 Feb 2005 16:30
Date: Tue, 15 Feb 2005 16:30
39 lines
2612 bytes
2612 bytes
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:
<421223ed@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!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>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, 15 Feb 2005 17:30:13 +0100 From: Hans Galema <notused@notused.nl> User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) 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> In-Reply-To: <42120c10@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 129.125.201.248 Message-ID: <421223ed@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1108485101 129.125.201.248 (15 Feb 2005 08:31:41 -0800) Lines: 39 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail