🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: threadblocking server connection handling

#4149
From: Hans Galema
Date: Thu, 24 Mar 2005 13:48
21 lines
1708 bytes
havl wrote:

> the problem is that checking the ClientSocket->Connected property in the 
> client thread doesn't work
> even when client has already disconnected the property is still true
> the only way i can determine that client has disconnected is the fact that 
> he appears then as sending data (waitfordata returns true) but it's lenght 
> is zero. 

Which length ?

After WaitForData() returns true and a following Read() returns 0 then the
client is disconnected. Well all inside the timeout you gave before.

 > and it's not good because it can also happen on a slow connection
> and in addition it's not always happening when client is disconnecting 
> what's going on?

You were unclear about 'length'.

Hans.
Technical Details
Message-ID: <4242c5a1$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4242c0bb@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,541706e3e4df9e6e
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Thu, 24 Mar 2005 14:48:19 +0100
From: Hans Galema <notused@notused.nl>
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: Re: threadblocking server connection handling
References: <4242c0bb@newsgroups.borland.com>
In-Reply-To: <4242c0bb@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 129.125.201.248
Message-ID: <4242c5a1$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1111672225 129.125.201.248 (24 Mar 2005 05:50:25 -0800)
Lines: 21
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail