🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

socket disconnect detection.

#8268
From: Johan Elms�ter
Date: Mon, 08 Nov 2004 22:39
17 lines
1449 bytes
Hi i'm using sockets 2.0.
I have been trying to find a smooth way to see if a socket disconnected.

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.

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.
but that is
not a solution for me.

Any ideas...I'm getting crazy...

regards Johan
Technical Details
Message-ID: <418ff5e3@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!proxad.net!news-hub.cableinet.net!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,6ce82371864e0ae4,start
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "Johan Elms�ter" <johan.elmsater@bulletinboard.nu>
From: "Johan Elms�ter" <johan.elmsater@bulletinboard.nu>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: socket disconnect detection.
Date: Mon, 8 Nov 2004 23:39:38 +0100
Lines: 20
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 217.78.19.7
Message-ID: <418ff5e3@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1099953635 217.78.19.7 (8 Nov 2004 14:40:35 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!proxad.net!news-hub.cableinet.net!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail