🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Can I check for invalid TCustomWinSocket pointers?

#1830
From: Lesley Anne
Date: Mon, 09 Oct 2006 17:52
10 lines
1557 bytes
I have a TServerSocket that gets queries from client connections and sends a 
response back to the socket that requested it.  The problem is that it often 
has to check external databases before it can formulate its response, so 
there can be a brief delay before it has something to send back.  If during 
that time the client has disconnected, it causes an access violation when I 
try to send back the response to a socket that no longer exists.

I'd like to be able to check whether my TCustomWinSocket* still points to a 
valid active socket before I try sending the response to it.  Is there a 
good way to do that?
Technical Details
Message-ID: <452a8c67$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,f9dc4bb901912d81,start
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Lesley Anne" <mspfila-ng@yahoo.com>
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: Can I check for invalid TCustomWinSocket pointers?
Date: Mon, 9 Oct 2006 13:52:37 -0400
Lines: 12
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
NNTP-Posting-Host: 144.160.5.25
Message-ID: <452a8c67$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1160416359 144.160.5.25 (9 Oct 2006 10:52:39 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail