How to get client IP address in DataSnap 2010

Can anyone tell me how to get the client ip of the connected session from the server side?

thanks

+4
source share
2 answers
procedure TMyDSService.DataSnapServerConnect(DSConnectEventObject: TDSConnectEventObject); var Conn: TIdTCPConnection; begin Conn := TIdTCPConnection(DSConnectEventObject.ChannelInfo.Id); Trace('Client ' + Conn.Socket.Binding.PeerIP +':' + IntToStr(Conn.Socket.Binding.PeerPort)); Trace('Client info: ' + DSConnectEventObject.ChannelInfo.Info); end; 
+5
source

You request Request.RemoteAddr to get the IP address of the connected client.

+3
source

Source: https://habr.com/ru/post/1299765/


All Articles