Click to See Complete Forum and Search --> : IP changes in Windows 2000


Abdul Kareem
August 22nd, 2001, 11:03 AM
Hi all,
I have a socket application which is running on Windows 2000. My socket application has been using local machine IP address to create a socket. Okay. at run time of the application, user can change local machine IP address throught network properties. Now in windows 2000, we dont need to restart machine after IP changes. After IP changes my application's communication will break. It want to restart again. So is there any way to know IP changes in my application, like IP change events or something?.

All comments are welcome.


~Kareem~
http://abdul-kareem.tripod.com
------------------------------------
If it is a useful one, You can rate it!!

santoshdsingh
August 23rd, 2001, 03:06 AM
theer is no way by which u can track the change of IP address. how ever in order to get the new ip u can creat an array of socket which will keep intiliazing and deintializing and thus u getting the new IP address always.

Regards

SantoshDSingh©®™
Do good things and all Good things will happen to you

urs
August 23rd, 2001, 07:21 AM
hi
u can try out timer
i mean at regular intervals u can call the function to get IP

Abdul Kareem
August 23rd, 2001, 08:30 AM
I didnt get you exactly what do you mean by creating array and initializing and deinitializing.

~Kareem~
http://abdul-kareem.tripod.com
------------------------------------
If it is a useful one, You can rate it!!

santoshdsingh
August 27th, 2001, 09:01 PM
hi abdul:

There are two possible situations to your problem... one is the IP address does not change and another is IP address can change during runtime.

For the first case no problem for you... you will always get the IP addres with the help of socket localIP function.

But when the local IP changes the socket will still have the old IP with it.

Now possible solutions...

A> Create a array of socket not just one socket. I mean like u create array of controls. And initialize the new element of array when you feel like. When initialized it will pick up the local IP of that particular time and not the old one.

B> theer is another code by which you continue to get the current local IP of the machine. It is not entirely with the help of socket though... it is done with he help of some API functions. If you would like to have a copy... let me know in email at santoshdsingh@yahoo.com i will mail you that

Hope that helps

Cheers


Regards

SantoshDSingh©®™
Do good things and all Good things will happen to you