Question

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.

Était-ce utile?

La solution

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top