🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

threadblocking server connection handling

#4148
From: havl
Date: Thu, 24 Mar 2005 13:30
17 lines
1676 bytes
i have finally no idea how are socket connections controlled

i've derived TSeverClientThread to handle a single client connection
it's a loop because i cannot waste time on connecting and disconnecting 
every time client want's something from the server. it has own read and 
write buffers and some control variables

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. 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?

thanks for help 
Technical Details
Message-ID: <4242c0bb@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,541706e3e4df9e6e,start
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "havl" <havl83@wp.pl>
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: threadblocking server connection handling
Date: Thu, 24 Mar 2005 14:30:30 +0100
Lines: 19
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: 81.219.101.38
Message-ID: <4242c0bb@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1111670971 81.219.101.38 (24 Mar 2005 05:29:31 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail