🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Multiple TIdTCPServer

#4878
From: Paul Machiaverna
Date: Fri, 03 Dec 2004 13:04
47 lines
2449 bytes
Just as Gambit as posted, it's very easy to bind the port
numbers at runtime.  In an application that I'm responsible for,
the port numbers are read from the Windows Registry.   Just an idea...

Paul Mac

"Willie" <Willie.nospam@nospam.pchome.com.tw> wrote:
>Hello Remy:
>
>Thank you very much.
>
>Willie.
>
>"Remy Lebeau (TeamB)" <no.spam@no.spam.com> ���g��l��s�D
>:41b03338@newsgroups.borland.com...
>>
>> "Willie" <Willie.nospam@nospam.pchome.com.tw> wrote in message
>> news:41aff392@newsgroups.borland.com...
>>
>> > For some reason, I needed to setup the binding ports at runtime.
>> > How can I setup the binding ports at runtime programmatically?
>>
>> Have you not read the Indy documentation yet?  TIdTCPServer has a Bindings
>> property, which in turn has an Add() method.  Before activating the
>server,
>> aall Add() first and then set the IP and Port of the new TIdSocketHandle
>> instance that Add() returns.  For example:
>>
>>     IdTCPServer1->Bindings->Clear();
>>
>>     TIdSocketHandle *pBinding = IdTCPServer1->Bindings->Add();
>>     pBinding->IP = "192.168.1.1";
>>     pBinding->Port = 4000;
>>
>>     pBinding = IdTCPServer1->Bindings->Add();
>>     pBinding->IP = "192.168.1.1";
>>     pBinding->Port = 4001;
>>
>>     IdTCPServer1->Active = true;
>>
>>
>> Gambit
>>
>>
>
>
Technical Details
Message-ID: <41b07254$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <41af3d4c$1@newsgroups.borland.com> <41af46ae$1@newsgroups.borland.com> <41afd835$1@newsgroups.borland.com> <41afed35$1@newsgroups.borland.com> <41aff392@newsgroups.borland.com> <41b03338@newsgroups.borland.com> <41b06d88$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,bcb11f40fbaab32b
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII
From: "Paul Machiaverna" <paul.machiaverna@i-stat.com>
Sender: "Paul Machiaverna" <paul.machiaverna@i-stat.com>
Reply-To: "Paul Machiaverna" <paul.machiaverna@i-stat.com>
Subject: Re: Multiple TIdTCPServer
Newsgroups: borland.public.cppbuilder.internet.socket
X-User-Info: 130.36.11.141     
References:  <41af3d4c$1@newsgroups.borland.com> <41af46ae$1@newsgroups.borland.com> <41afd835$1@newsgroups.borland.com> <41afed35$1@newsgroups.borland.com> <41aff392@newsgroups.borland.com> <41b03338@newsgroups.borland.com> <41b06d88$1@newsgroups.borland.com>
NNTP-Posting-Host: 207.105.83.66
Message-ID: <41b07254$1@newsgroups.borland.com>
Date: 3 Dec 2004 06:04:04 -0700
X-Trace: newsgroups.borland.com 1102082644 207.105.83.66 (3 Dec 2004 06:04:04 -0700)
Lines: 48
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail