1

I always worked with indy 9 and Delphi 7. I have quite experience with it now and but would like to go a little bit further. I would like to listen to multiple ports and don't know how I should do this. There are also concerns if I will be able to add/remove ports while the server is active. So here are a few questions I would like to know the answer to:

  1. How can I add a new port to the bindings, while the server is already active?
  2. How can I remove a port from the bindings, while the server is already active?
  3. When I remove the bindings, how/will does Indy disconnect the clients from the port?
  4. What happens to the defaultPort property?

Thank you for your answers.

Ben
  • 3,380
  • 2
  • 44
  • 98
  • 1
    Indy 10 is available since the days of Delphi 7 (more or less), and Indy 11 is under active development now and Indy 9 have no love for years, so, consider updating your code to Indy 10. – jachguate Nov 09 '12 at 02:21

1 Answers1

2

1.How can I add a new port to the bindings, while the server is already active?

2.How can I remove a port from the bindings, while the server is already active?

3.When I remove the bindings, how/will does Indy disconnect the clients from the port?

All three questions have the same answer - what you are asking for is not supported (not even in Indy 10). You must deactivate a server before you can make any changes to its Bindings collection. If that does not suit your needs, then you will have to use a separate server component for each IP/Port pair you want to listen on. That way, you can activate/deactivate them individually as needed. Deactivating a server automatically disconnects all active clients that are connected to it.

4.What happens to the defaultPort property?

The DefaultPort property is only used to initialize the TIdSocketHandle.Port property when adding a new entry to the Bindings collection. It is not used for anything else.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • However I figured I can start new instances of TIdTCPServer. This would do the trick. – Ben Nov 09 '12 at 02:51