joroberto
(Roberto)
1
How to create a method that I return the ip of the clients connected to the server?
Ps. I use SynapseSuperTCPServer.
I try this, but not work.
function TNewService.GetIP:AnsiString;
var
tcpinfo: IROTCPTransport;
begin
Result := tcpinfo.ClientAddress;
end;
Roberto.
ClaudioP
(Claudio Piffer)
2
Hi,
in your service, add the event OnGetDispatchinfo and add this code:
var
tcpinfo: IROTCPTransport;
begin
if Supports( aTransport, IROTCPTransport, tcpinfo ) then
FClientIP := tcpinfo.ClientAddress;
{FClientIP is a string variable in my case defined in the class definition}
end;
Best Regards
Claudio
joroberto
(Roberto)
3
Thank you Claudio,
You can send you an example of how to use this event?
Roberto.
ClaudioP
(Claudio Piffer)
4
Hi Roberto,
yes of course.
I just created a simple sample with the wizard and added the code in the OnGetDispacthInfo event.
Let me know 
Best Regards
Claudio
joroberto
(Roberto)
5
Hello Claudio.
Your example worked perfectly.
But their service is a remotedatamodule where you can set the event. But my service is a TRORemotable. How do I set this event ?
Roberto.
ClaudioP
(Claudio Piffer)
6
Hi Roberto,
yes you can, just add the IRODispatchNotifier interface to its declaration and provide an implementation for the method GetDispatchInfo.
read this in the wiki:
http://wiki.remobjects.com/wiki/IRODispatchNotifier_Interface
Best Regards
Claudio