🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Modify the timeout for open() method

#3073
From: enzo
Date: Fri, 02 Dec 2005 07:57
26 lines
2057 bytes
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> ha scritto nel messaggio
news:438f4204$1@newsgroups.borland.com...
>
> "enzo" <enzo.arlati@aesys.it> wrote in message
> news:438ed040@newsgroups.borland.com...
> Are you using the TClientSocket in blocking or non-blocking mode?
>
> In blocking mode, you will have to use a separate worker thread to
> disconnect the socket if it is not connected after your timeout elapses.

I create and open the socket in blocking mode from inside a thread.
As the example belowe :
           clientSck = new TClientSocket( NULL );
           clientSck->ClientType = ctBlocking;
           clientSck->Address = ipTarge;
           clientSck->Port = portTarget;
           clientSck->Open();
           if( clientSck->Active == false ) return;

I need to make a fast check before call the open or mybe shorten the timeout
if I call open on a pc not ready to listen.
what do you mean for a separate thread to disconnect the socket, can you
provide me an example ?

thanks, Enzo
Technical Details
Message-ID: <438ffe59@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <438ed040@newsgroups.borland.com> <438f4204$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,234cf6f94ba290e1
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "enzo" <enzo.arlati@aesys.it>
From: "enzo" <enzo.arlati@aesys.it>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <438ed040@newsgroups.borland.com> <438f4204$1@newsgroups.borland.com>
Subject: Re: Modify the timeout for open() method
Date: Fri, 2 Dec 2005 08:57:59 +0100
Lines: 30
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
NNTP-Posting-Host: 81.208.124.114
Message-ID: <438ffe59@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1133510233 81.208.124.114 (1 Dec 2005 23:57:13 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail