04-28-2018, 05:57 AM
(04-26-2018, 05:24 PM)rlebeau Wrote: Internally, the BoundIP is passed to the socket API bind() function. On most platforms, that is usually enough. But, on some systems, binding to a specific interface can also be done using the SO_BINDTODEVICE option of the socket API setsockopt() function instead
I spend hours trying to get my head around this.
I tried this:
IdTCPClient1.Socket.Binding.SetBinding(NetworkData.LocalIP,APort);
This has no effect. PS: What function is the Port in this case? Does this have any effect on setting the socket, and if so, what Port am I supposed to use?
Then,
SetSockOpt(ALevel: TIdSocketOptionLevel; AOptName: TIdSocketOption; AOptVal: Integer);
Those are three integers I am supposed to supply. I have no idea what these mean.
Also, after hours digging through the Android API (24) help, I cannot find any way to retrieve an integer which I could use to call SetSockOpt() with.
https://developer.android.com/reference/...et/Network
Going through the source of Indy, it ends with an GStack.SetSocketOption(Handle, ALevel, AOptName, AOptVal); overload; virtual; abstract;
of which I cannot find the actual source code to see what it does...
PS: After I assign the "IdTCPClient1.IOHandler := IdSSLIOHandlerSocketOpenSSL1;" , calls to the IdTCPClient1.Socket.Binding.SetBinding will be passed on to IdSSLIOHandlerSocketOpenSSL1 where required?
Thanks, Bart