🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Unresolved external 'Idantifreeze::TIdAntiFreeze:

#2908
From: Remy Lebeau (TeamB)
Date: Mon, 09 Jan 2006 10:35
51 lines
2339 bytes
"Liu Shan" <liushan@ps-electronic.com> wrote in message 
news:43c1be5a$1@newsgroups.borland.com...

> But once I run the code below, I always got result = false,
> so I still cannot start server.

Your code is using the checked status of only the *last* item in the list to 
decide whether to activate the server.  If the last item is not checked, 
your code ignores the activation altogether.

Try this code:

    IdTCPServer->Active = false;
    IdTCPServer->Bindings->Clear();

    fServerRunning = false;

    for(i = 0; i <  lbIPs->Count; ++i)
    {
        if( lbIPs->Checked[i] )
        {
            Binding = IdTCPServer->Bindings->Add();
            Binding->IP = lbIPs->Items->Strings[i];
            Binding->Port = StrToInt(edtPort->Text);
            //...
        }
    }

    if( IdTCPServer->Bindings->Count > 0 )
    {
        IdTCPServer->Active = true;
        fServerRunning = IdTCPServer->Active;
    }

    //...

    if( fServerRunning )
    {
        //...
    }
    else
    {
        //...
    }

    Result = fServerRunning;
    //...


Gambit 
Technical Details
Message-ID: <43c23f02@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news4.google.com!news.glorb.com!meganewsservers.com!feeder2.on.meganewsservers.com!news-out.superfeed.net!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <43bcec76$1@newsgroups.borland.com> <43bd5f66$1@newsgroups.borland.com> <43bdcbd3$1@newsgroups.borland.com> <43bdd68e@newsgroups.borland.com> <43be37e8@newsgroups.borland.com> <43bebfd0$1@newsgroups.borland.com> <43c1be5a$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,a9ad1d742dfc75bf
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <43bcec76$1@newsgroups.borland.com> <43bd5f66$1@newsgroups.borland.com> <43bdcbd3$1@newsgroups.borland.com> <43bdd68e@newsgroups.borland.com> <43be37e8@newsgroups.borland.com> <43bebfd0$1@newsgroups.borland.com> <43c1be5a$1@newsgroups.borland.com>
Subject: Re: Unresolved external 'Idantifreeze::TIdAntiFreeze:
Date: Mon, 9 Jan 2006 02:35:37 -0800
Lines: 53
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 68.69.17.41
Message-ID: <43c23f02@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1136803586 68.69.17.41 (9 Jan 2006 02:46:26 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news4.google.com!news.glorb.com!meganewsservers.com!feeder2.on.meganewsservers.com!news-out.superfeed.net!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail