I am using Delphi Berlin.
In a server (inside the dataModule derived from TRORemoteDataModule, how can I get the address of the client which is calling a remote method?
I know that are some solutions floating around but I couldn’t make them work.
There is one which consists of coding the
procedure GetDispatchInfo(const aTransport: IROTransport; const aMessage: IROMessage);
But after coding it like:
procedure TChavesAtualizacao.GetDispatchInfo( const aTransport: IROTransport; const aMessage: IROMessage); var tcpinfo: IROTCPTransport; address: string; begin if Supports(aTransport, IROTCPtransport, tcpinfo) then begin address := tcpinfo.GetClientAddress; end; end;
It doesn’t get called.
Is there other way to get it? Should I have to do anything else to get it called?
Moreover, even if it’s called, I suppose that it will be called by all threads so it is safe to save the IP address in a property and get access to it in the method afterwards, eg, is the real method executed just after this method in order to get the right client address?