Does changing DefaultPort in IdFTPServer should require Bindings clear?

Giganews Newsgroups
Subject: Does changing DefaultPort in IdFTPServer should require Bindings clear?
Posted by:  Tomasz B (t.berg.REMO…@slican.pl)
Date: Fri, 21 Aug 2009

Hello,

I though that changing DefaultPort when server is not active should be
enough to apply port number changes. But it looks like I've to clear
bindings also.

  IdFTPServer->Active = false;
  IdFTPServer->Bindings;

  //without this lines changing port makes no effect
  if (IdFTPServer->Bindings) {
    IdFTPServer->Bindings->Clear();
  }
  //-

  IdFTPServer->DefaultPort = aNumber;
  IdFTPServer->Active = true;

Am I do it properly? Maybe it should be done in another way?

I use Indy 10 /C++ Builder 6.

--
Best regards
Tomasz Berg

Replies