I need to know the local port of Indy TCP Client component during it is connecting with server. As I read the manual, the BoundPort is local port of Indy Client component. But this value always returns 0, not real local port. Really BountPort indicates the local port of client component? And I took mistakes when getting it? Or,any other good method of detecting the local port?
The TIdTCPClient.BoundPort property is the port that YOU want the client to bind to locally. It is 0 by default, so the client can bind to whatever random port is available. Regardless of what the BoundPort is set to, the port that is actually bound to is available in the TIdTCPClient.Socket.Binding.Port property after the TIdTCPClient.Connect() method is successful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With