I'm trying to get a client's IP address and other client information using DSServer
's onconnect
event with the following code.
My problem is that DSConnectEventObject.ChannelInfo
is nil
every time. Additionally, I can't resolve the IP addresses.
Please help me. Thank you.
procedure TWebModule1.DSServer1Connect(DSConnectEventObject: TDSConnectEventObject);
var
ci: TDBXClientInfo;
begin
ci := DSConnectEventObject.ChannelInfo.ClientInfo;
AddLog(Format('Client %s Connected IP: %s, Port: %s',
[ci.Protocol, ci.IpAddress, ci.ClientPort])
);
end;