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.