get ip address
-
- New User
- Posts: 6
- Joined: Sun Feb 20, 2005 10:35 pm
-
- Addict
- Posts: 1648
- Joined: Mon Sep 20, 2004 3:52 pm
- Contact:
Thanks for your procedure olejr
Using purebasic functions and pre-defined structures this can be reduced to:
Using purebasic functions and pre-defined structures this can be reduced to:
Code: Select all
Procedure.s GetClientIP(ClientID)
s=SizeOf(sockaddr_in)
res=getpeername_(ClientID,@ip.sockaddr_in,@s)
If res = 0
remotip$=IPString(ip\sin_addr)
Else
remotip$ = ""
EndIf
ProcedureReturn remotip$
EndProcedure
Re: get ip address
Whats wrong with this one?
https://www.purebasic.com/documentation ... entip.html
https://www.purebasic.com/documentation ... entip.html
quidquid Latine dictum sit altum videtur
Re: get ip address
I didn't know about it. Will that return your external IP address like the topic says? If so, how do we use it? I don't understand the manual for it as I'm not network-savvy.
Re: get ip address
The function does what is discussed in this topic: returns the IP of the client connected to your network server. Not your own.
Why do you bump a 15 year old topic if you don't even understand what is asked there? The issue discussed here has been solved for almost as long as the topic exists.
What you are asking for is currently being discussed here: viewtopic.php?f=13&t=74663
Why do you bump a 15 year old topic if you don't even understand what is asked there? The issue discussed here has been solved for almost as long as the topic exists.
What you are asking for is currently being discussed here: viewtopic.php?f=13&t=74663
quidquid Latine dictum sit altum videtur