🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TClientSocket in blocking mode ...

#5373
From: Mark Jacobs
Date: Tue, 24 Aug 2004 11:09
27 lines
1768 bytes
On Fri, 20 Aug 2004 11:00:53 +0200, Andreas Tirok <at1712@web.de> wrote:

> is there anywhere an example of TClientSocket in blocking mode.

       static char bf[999999];
       ClientSocket1->Open();
       Application->ProcessMessages();
       csstream=new TWinSocketStream(ClientSocket1->Socket,60000);
       if (!csstream->WaitForData(5000))
         Memo1->Lines->Append("Nothing to read in 5 seconds");
       else
       {
         memset(bf,0,999998);
         csstream->Read(bf,999998);
         Memo1->SetSelTextBuf(bf);
       }
       // ... whatever else you want to do ...
       delete csstream;

HTH
-- 
Mark Jacobs
DK Computing
http://www.dkcomputing.co.uk
markj atty critical dotty co dotty uk
Technical Details
Message-ID: <opsc8g98pgbvaws7@dk-tzx09ucg42z4.s1.sol1.co.uk>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!border1.nntp.dca.giganews.com!nntp.giganews.com!peer01.cox.net!cox.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <4125bdc6$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,b0259efaad300f7e
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: Re: TClientSocket in blocking mode ...
Reply-To: markjattycriticaldottycodottyuk
References: <4125bdc6$1@newsgroups.borland.com>
Message-ID: <opsc8g98pgbvaws7@dk-tzx09ucg42z4.s1.sol1.co.uk>
Date: Tue, 24 Aug 2004 12:09:34 +0100
From: "Mark Jacobs" <markjattycriticaldottycodottyuk>
Organization: DK Computing
Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15
MIME-Version: 1.0
Content-Transfer-Encoding: Quoted-Printable
User-Agent: Opera M2/7.53 (Win32, build 3850)
NNTP-Posting-Host: 81.144.157.8
X-Trace: newsgroups.borland.com 1093345774 81.144.157.8 (24 Aug 2004 04:09:34 -0700)
Lines: 27
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!border1.nntp.dca.giganews.com!nntp.giganews.com!peer01.cox.net!cox.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail