Article View: borland.public.cppbuilder.internet.socket
Article #4482Re: Send buffer from server to a client
From: Hans Galema
Date: Thu, 27 Jan 2005 17:25
Date: Thu, 27 Jan 2005 17:25
27 lines
2361 bytes
2361 bytes
Vin๏ฟฝcius wrote: > There is a IdTCPClient1->ReadBuffer(...), but I can't call this in some > structure like execute on the server, or an event that set when the buffer > has something to read for the client. If exists somethig like this!!! I take > a look at "onWork" event but I don't understand how to use it.In > TClientSocket there is an event "OnClientRead", where we can read buffers > when its something to read. So your client is non-blocking. If it was blocking then your client could do a ReadBufer() rigth after the WriteBuffer(). At least if the server will send always after it received a message from the client. > This also exists, "AThread->Connection->WriteBuffer()", but only can be > called inside the events of the server, or I wrong?? > there no exists IdTCPServer->WriteBuffer(), and I don't want to call this > every time in a loop, like execute, I want to call this sometimes. You mean your thread's Execute() method ? You can call it in the Execute() method. How does the server behave ? Does it send only and always something after a request from the client. Or does it also send data at own initiative ? Is that where you want to call it 'sometimes' ? Hans.
Technical Details
Message-ID:
<41f92451$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!transit.nntp.hccnet.nl!transit1.nntp.hccnet.nl!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<41f90c54@newsgroups.borland.com> <41f91223$1@newsgroups.borland.com> <41f91ff2@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,2b30b06ce9be7f64 X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII Date: Thu, 27 Jan 2005 18:25:34 +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: Send buffer from server to a client References: <41f90c54@newsgroups.borland.com> <41f91223$1@newsgroups.borland.com> <41f91ff2@newsgroups.borland.com> In-Reply-To: <41f91ff2@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit NNTP-Posting-Host: 129.125.201.248 Message-ID: <41f92451$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1106846801 129.125.201.248 (27 Jan 2005 09:26:41 -0800) Lines: 27 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!transit.nntp.hccnet.nl!transit1.nntp.hccnet.nl!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail