🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #8307

Re: socket disconnect detection.

#8307
From: Johan Elms�ter
Date: Wed, 10 Nov 2004 22:10
40 lines
2314 bytes
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:419001bd$1@newsgroups.borland.com...
>
> "Johan Elms�ter" <johan.elmsater@bulletinboard.nu> wrote in message
> news:418ff5e3@newsgroups.borland.com...
>
>> I have been trying to find a smooth way to see if a socket disconnected.
>
> The subject of many discussions.  There is no simple single way to do 
> that.
>
>> for example if is use "recv" socket call it will return SOCKET_ERROR
>> if the connection was not gracefully shutdown, but if it was
>> gracefully shutdown, it will only return zero.
>
> You did not mention whether you are using blocking or non-blocking 
> sockets.
> It makes a difference.

  blocking sockets.
>
>> I have tried lot's of things but I can't find anyway to do this except
>> from using a "timer" and timeout the connection if no data has been
>> received in a specific time.
>
> That is the common approach to the issue.
>
>> but that is not a solution for me.
>
> Why not?

   I'm using lot's of clients, and I dont want the network traffic to be to 
high
  just for sending "keep alive" messages.
>
>
> Gambit
>
> 
Technical Details
Message-ID: <41929214@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.freenet.de!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news-hub.cableinet.net!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <418ff5e3@newsgroups.borland.com> <419001bd$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,6ce82371864e0ae4
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII
Reply-To: "Johan Elms�ter" <johan.elmsater@bulletinboard.nu>
From: "Johan Elms�ter" <johan.elmsater@bulletinboard.nu>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <418ff5e3@newsgroups.borland.com> <419001bd$1@newsgroups.borland.com>
Subject: Re: socket disconnect detection.
Date: Wed, 10 Nov 2004 23:10:31 +0100
Lines: 42
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: 217.78.19.7
Message-ID: <41929214@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1100124692 217.78.19.7 (10 Nov 2004 14:11:32 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.freenet.de!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news-hub.cableinet.net!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail