Article View: borland.public.cppbuilder.internet.socket
Article #4864Re: Multiple TIdTCPServer
From: Remy Lebeau (TeamB)
Date: Fri, 03 Dec 2004 09:34
Date: Fri, 03 Dec 2004 09:34
26 lines
1894 bytes
1894 bytes
"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:
<41b03338@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news-FFM2.ecrc.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<41af3d4c$1@newsgroups.borland.com> <41af46ae$1@newsgroups.borland.com> <41afd835$1@newsgroups.borland.com> <41afed35$1@newsgroups.borland.com> <41aff392@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,bcb11f40fbaab32b 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: <41af3d4c$1@newsgroups.borland.com> <41af46ae$1@newsgroups.borland.com> <41afd835$1@newsgroups.borland.com> <41afed35$1@newsgroups.borland.com> <41aff392@newsgroups.borland.com> Subject: Re: Multiple TIdTCPServer Date: Fri, 3 Dec 2004 01:34:44 -0800 Lines: 28 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <41b03338@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1102066488 68.69.17.41 (3 Dec 2004 01:34:48 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news-FFM2.ecrc.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail