Article View: borland.public.cppbuilder.internet.socket
Article #4329Re: Breaking out of a blocking call
From: Vladimir Stefanovic
Date: Thu, 10 Feb 2005 14:45
Date: Thu, 10 Feb 2005 14:45
41 lines
2202 bytes
2202 bytes
I myself have *not* found the way to control the 'waiting
to connect time' in blocking mode. For example, I wanted
to abort if the connection was not established in 1 second.
In NonBlocking mode it was easy.
--
Best regards,
Vladimir Stefanovic
"Lynn Morrison" <Cranky@__whisp.com> wrote in message
news:420b53bb$1@newsgroups.borland.com...
> Hi, I am having problems with a socket giving me an access violation. I am
> using the API to do my own socket code in blocking mode. When, for
> example,
> my socket(used in an ftp app) has a reply from the server such as "Opening
> data connection for xxx.xxx.xxx.xxx on port xxxx" and because of a
> firewall
> or one of those proxy style routers, I get access violations when trying
> to
> shut down the socket...
>
> if(AbortPressed) {
> int retval = shutdown(DataSockHandle,SD_BOTH);
> return retval;
> }
>
> this returns WSAEINPROGRESS all the time, but how do I FORCE it to
> shutdown?
> I tried just looping while I wait for it to return, but that sometimes is
> infinitely on some servers... I tried WSACancelBlockingCall, but with
> winsock 2 that function is obsolete.
>
> What other options do I have?
>
> Lynn
>
>
>
>
>
>
Technical Details
Message-ID:
<420b7364$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!solnet.ch!solnet.ch!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<420b53bb$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,4dbc2d4a94baf63e X-Google-Attributes: gid11508e,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Vladimir Stefanovic" <antivari@po.sbb.co.yu> Newsgroups: borland.public.cppbuilder.internet.socket References: <420b53bb$1@newsgroups.borland.com> Subject: Re: Breaking out of a blocking call Date: Thu, 10 Feb 2005 15:45:03 +0100 Lines: 43 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 82.117.212.65 Message-ID: <420b7364$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1108046692 82.117.212.65 (10 Feb 2005 06:44:52 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!solnet.ch!solnet.ch!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail