🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Can I check for invalid TCustomWinSocket pointers?

#1833
From: Lesley Anne
Date: Mon, 09 Oct 2006 21:17
20 lines
1919 bytes
Remy Lebeau (TeamB) wrote:
>
> The only way to validate the pointer is to see if it still exists
> in the server's Connection's list.

OK, thanks.  I added a function to check for it that way and it seems to 
work.


> Otherwise, you will have to update your code to set your
> stored pointers to NULL when the OnDisconnect event occurs, and then
> have your database code check for NULL before writing to the socket.

The search for matching pointers is a little more complicated there and 
would require additional indexing on my database of outstanding 
transactions, so I'm going to start off with the other method.  This is 
worth keeping in mind, though, because I should be getting more response 
events than disconnect events.  If I need to start fine tuning this app for 
throughput issues, I'll check whether I get better performance by updating 
pointers on the (less frequent) OnDisconnect event.
Technical Details
Message-ID: <452abc75$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <452a8c67$1@newsgroups.borland.com> <452aa627$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,f9dc4bb901912d81
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
References: <452a8c67$1@newsgroups.borland.com> <452aa627$1@newsgroups.borland.com>
Subject: Re: Can I check for invalid TCustomWinSocket pointers?
Date: Mon, 9 Oct 2006 17:17:38 -0400
Lines: 22
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: <452abc75$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1160428661 144.160.5.25 (9 Oct 2006 14:17:41 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail