I’m building an XE2 DataSnap server which will serve connections from REST clients. My DSServerClass LifeCycle property is set to ‘Invocation’. What I want to do is to log the details of all client connections to the server, including the following details : username, IP address, protocol, application name. I can currently get these details using the following events :
DSAuthenticationManager – UserAuthenticate() : username, protocol (using the standard parameters passed in)
DSServer – Connect() : protocol, IP address, application name (using DSConnectEventObject.ChannelInfo.ClientInfo)
What I want to do is just log once for all details, but it seems I can’t get all the details I need in one event. I tried using a shared private variable in the class but as expected this gave inconsistent results – the wrong IP address against the wrong username. Is there another way to achieve what I want?
Jonathan
You can use
TDSServer.OnConnectevent (which is called afterTDSAuthenticationManager.OnUserAuthenticate). There you have access toChannelInfo.ClientInfoas you’ve discovered and alsoConnectPropertiesfrom which you can read property values like this: