Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM Client/Server » View Thread |
Messages 1 to 5 of 5 total |
Remote Client IP Address |
Wed, May 20 2009 10:32 AM | Permanent Link |
Kyle Boatwright | I am using DBISAM 3.24 and I am calling a procedure on a server from a client PC. I have the ServerSession argument passed to the ServerProcedure procedure. How can I get the IP
address of the client making the call to the server procedure at this point? Thanks, Kyle |
Wed, May 20 2009 10:34 AM | Permanent Link |
Kyle Boatwright | Kyle Boatwright wrote:
I am using DBISAM 3.24 and I am calling a procedure on a server from a client PC. I have the ServerSession argument passed to the ServerProcedure procedure. How can I get the IP address of the client making the call to the server procedure at this point? Thanks, Kyle Sorry, I meant version 4.26... |
Wed, May 20 2009 10:44 AM | Permanent Link |
"Eduardo [HPro]" | Kyle
I use the following function. I don´t remember if you need to add "Winsock" unit at uses clause. function LocalIP : string; type TaPInAddr = array [0..10] of PInAddr; PaPInAddr = ^TaPInAddr; var phe : PHostEnt; pptr : PaPInAddr; Buffer : array [0..63] of char; GInitData: TWSADATA; begin Result := ''; WSAStartup($101, GInitData); try GetHostName(Buffer, SizeOf(Buffer)); phe := GetHostByName(buffer); if phe = nil then begin Exit; end; pptr := PaPInAddr(Phe^.h_addr_list); Result := StrPas(inet_ntoa(pptr^[0]^)); finally WSACleanup; end; end; Eduardo |
Wed, May 20 2009 1:25 PM | Permanent Link |
Kyle Boatwright | "Eduardo [HPro]" wrote:
Kyle I use the following function. I don´t remember if you need to add "Winsock" unit at uses clause. function LocalIP : string; type TaPInAddr = array [0..10] of PInAddr; PaPInAddr = ^TaPInAddr; var phe : PHostEnt; pptr : PaPInAddr; Buffer : array [0..63] of char; GInitData: TWSADATA; begin Result := ''; WSAStartup($101, GInitData); try GetHostName(Buffer, SizeOf(Buffer)); phe := GetHostByName(buffer); if phe = nil then begin Exit; end; pptr := PaPInAddr(Phe^.h_addr_list); Result := StrPas(inet_ntoa(pptr^[0]^)); finally WSACleanup; end; end; Eduardo Thanks, I really need the local IP address as it appears to the server (not necessarily the local IP address). I think I have the issue resolved, I was using the CurrentRemoteID value from the Session at the server and it was always zero. I just created a server side procedure that I pass the CurrentRemoteID from the client to, then sift thru the list of session on the server until I find that on and return the IP address to the client. |
Thu, May 21 2009 3:18 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Kyle,
<< Sorry, I meant version 4.26... >> The latest 4.27 includes a new function for this: http://www.elevatesoft.com/manual?action=mancompprop&id=dbisam4&product=d&version=7&comp=TDBISAMSession&prop=CurrentServerUserAddress -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Friday, March 29, 2024 at 03:30 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |