🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TIdTCPServer and TIdTCPClient

#1639
From: Remy Lebeau (TeamB)
Date: Wed, 13 Dec 2006 00:17
22 lines
1779 bytes
"Lapo Guidi" <lapoguidi@inwind.it> wrote in message
news:457f31bf@newsgroups.borland.com...

> At client side I do that:
> when user update a cell at Row, Col I send a command to the server
> TCPClient->SendCmd("UPDATE "+IntToStr(Row)+" "+IntToStr(Col));

That will not work anymore if you use a reading thread, as SendCmd()
performs its own reading internally.  So you have the possibility of the
thread receiving data that SendCmd() is expecting, and vice versa.

> So the Server receive the command and Client get Reply and Response
> back. But how could I code a Thread at client side to receive the data
> from the Server when the Client didn't send a command?

Simply call one of the appropriate reading methods of the connection in a
loop for the lifetime of the thread.  Look at the source code of the
TIdTelnet component for an example.


Gambit
Technical Details
Message-ID: <457f4644@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <457dfd00$1@newsgroups.borland.com> <457e38a7$3@newsgroups.borland.com> <457f31bf@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,ca59e93c485c82fe
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: <457dfd00$1@newsgroups.borland.com> <457e38a7$3@newsgroups.borland.com> <457f31bf@newsgroups.borland.com>
Subject: Re: TIdTCPServer and TIdTCPClient
Date: Tue, 12 Dec 2006 16:17:12 -0800
Lines: 24
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: 75.83.34.171
Message-ID: <457f4644@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1165968964 75.83.34.171 (12 Dec 2006 16:16:04 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail