🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Blocking Socket Help

#4632
From: Bob Gonder
Date: Fri, 07 Jan 2005 20:23
23 lines
1922 bytes
mike wrote:

In addition to what Remy said...
Could you have the server send a "shutdown" message to the clients so
they would cease trying to reconnect?

>void __fastcall TForm1::CloseAllSockets( void )
>{
>       for( int i = 0; i < ServerSocket2->Socket->ActiveConnections ; i++ )
>       {
>            ServerSocket2->Socket->Connections[ i ]->Close();

Just curious about perhaps another dumb question:
Will this code actually close all connections?
In VB, I would expect closing [0] would also remove it, thus what we
thought of as [1] would now be [0], so we would skip closing the
original [1], [3], [5], etc.
I don't know if the VCL is that "smart" (to remove closed connections
from the list immediately)
The remedy would be to close from the end to 0, or continualy close 0
until count==0.

>       }
Technical Details
Message-ID: <e8rtt0hpur3uhbmfu9aocea2u76lr1qqvd@4ax.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!news2.euro.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <41deb491$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,b1c5fb84bd800066
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: Re: Blocking Socket Help
Date: Fri, 07 Jan 2005 12:23:36 -0800
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <e8rtt0hpur3uhbmfu9aocea2u76lr1qqvd@4ax.com>
References: <41deb491$1@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 69.69.90.67
X-Trace: newsgroups.borland.com 1105129414 69.69.90.67 (7 Jan 2005 12:23:34 -0800)
Lines: 24
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!news2.euro.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail