🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Close down connections from the server side. Indy.

#5409
From: Ulrik Nilsson
Date: Mon, 06 Sep 2004 18:49
33 lines
1688 bytes
Hi!

I need help with to close down all connections from the server (Indy 9).

This is a part of my code

void __fastcall TForm1::FormCreate(TObject *Sender)
{
    mUserMutex = CreateMutex(NULL, false, NULL);
    Users = 0;
    UpdateUsers();
    TCPServer->Active = true;
}

void __fastcall TForm1::Close_ButtonClick(TObject *Sender)
{
    TCPServer->Active = false;
}

void __fastcall TForm1::TCPServerExecute(TIdPeerThread *AThread)

    AnsiString str = AThread->Connection->ReadLn("\n", 2000, 10);
    //AnsiString str = AThread->Connection->ReadLn();


The problem is that my program stops at one of the above lines.
It doesn't matter which I use when I click the "Close" button.
And, of course, no OnDisconnect is fired in the client.

Any code snippet would be very much appreciated.

Regards Ulrik
Technical Details
Message-ID: <413cb130$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,94b92865a961b40,start
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Ulrik Nilsson" <di2niul@chl.chalmers.se>
Sender: "Ulrik Nilsson" <di2niul@chl.chalmers.se>
Reply-To: "Ulrik Nilsson" <di2niul@chl.chalmers.se>
Subject: Close down connections from the server side. Indy.
Newsgroups: borland.public.cppbuilder.internet.socket
X-User-Info: 213.114.98.47     
NNTP-Posting-Host: 207.105.83.66
Message-ID: <413cb130$1@newsgroups.borland.com>
Date: 6 Sep 2004 11:49:20 -0700
X-Trace: newsgroups.borland.com 1094496560 207.105.83.66 (6 Sep 2004 11:49:20 -0700)
Lines: 35
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail