🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Timeout for TClientServer in ctBlocking ...

#5159
From: Vladimir Stefanovic
Date: Tue, 12 Oct 2004 14:45
44 lines
1885 bytes
I have TClientSocket in ctBlocking mode.

How can I reduce the time for waiting for the
connection to be established.

In ctNonBlocking mode I use something like this:

   ClientSocket->Active = true;
   int ms_start = GetTickCount();
   while ( GetTickCount() - ms_start < 1000 )
   {
      Forms::Application->ProcessMessages();
      if ( ClientSocket->Active )
         break; // Speed-up if the connection is establ.
   }

   if ( !ClientSocket->Active )
   {
      // Not connected during one second ...
      // etc, ...


In ctBlocking mode this (of course) does not work
nor the TTimer (?!). It seems that timer is also 'dead'
while ...

   ClientSocket->Active = true;

...is not finished. What can I do? Maybe some real thread...

Also, when I decide to abandon the process of connecting,
how can I really stop it. Should I use

   ClientSocket->OnError( this,0,0,0 );

or just

   ClientSocket->Active = false;




Best regards,
Vladimir Stefanovic
Technical Details
Message-ID: <416bede7@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!zen.net.uk!dedekind.zen.co.uk!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,230ad6ee6657e1fc,start
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Vladimir Stefanovic" <spam@not.needed>
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: Timeout for TClientServer in ctBlocking ...
Date: Tue, 12 Oct 2004 16:45:47 +0200
Lines: 47
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
NNTP-Posting-Host: 213.137.116.129
Message-ID: <416bede7@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1097592295 213.137.116.129 (12 Oct 2004 07:44:55 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!zen.net.uk!dedekind.zen.co.uk!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail