GetClientIP() returns 0.0.0.0

Just starting out? Need help? Post your questions and find answers here.
AndyMK
Enthusiast
Enthusiast
Posts: 582
Joined: Wed Jul 12, 2006 4:38 pm
Location: UK

GetClientIP() returns 0.0.0.0

Post by AndyMK »

IPString(GetClientIP(ClientID)) returns 0.0.0.0 when a client disconnects from a server. The ClientID is ok. Is the IP address deleted for that ClientID when the client disconnects? If i need to know the IP of a client that just disconnected, must i store it somewhere when it connected?
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: GetClientIP() returns 0.0.0.0

Post by IdeasVacuum »

Well, I am not an expert by any means but if the Client is disconnected, how can the Server get the Client's IP Address? it's 'not there' is it?

If i need to know the IP of a client that just disconnected, must i store it somewhere when it connected?

Sounds logical.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
AndyMK
Enthusiast
Enthusiast
Posts: 582
Joined: Wed Jul 12, 2006 4:38 pm
Location: UK

Re: GetClientIP() returns 0.0.0.0

Post by AndyMK »

Don't you find it strange that the ClientID is returned but not the IP? Since the IP is obtained from the ClientID, i just find it odd but thanks for the reply, i'll store it on connection.
eesau
Enthusiast
Enthusiast
Posts: 589
Joined: Fri Apr 27, 2007 12:38 pm
Location: Finland

Re: GetClientIP() returns 0.0.0.0

Post by eesau »

AndyMK wrote:Don't you find it strange that the ClientID is returned but not the IP? Since the IP is obtained from the ClientID, i just find it odd but thanks for the reply, i'll store it on connection.
Can you have multiple connections per IP? If yes, it makes much more sense to return the clientID and not the IP.

Disclaimer: I haven't used PB's networking library at all, so I really don't know.
Suirad
User
User
Posts: 42
Joined: Sun Sep 20, 2009 7:37 pm
Location: Melbourne, Florida, USA

Re: GetClientIP() returns 0.0.0.0

Post by Suirad »

You would be better off using the clientid as an identifyer for the client than the ip because it will always be shown whenever an event occurs by that client.
Post Reply