CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 1999
    Location
    TVM, Kerala, India
    Posts
    210

    IP changes in Windows 2000

    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!!

  2. #2
    Join Date
    Aug 2001
    Location
    Seoul. South Korea
    Posts
    4

    Re: IP changes in Windows 2000

    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

  3. #3
    Join Date
    Jul 2001
    Location
    maharashtra,india
    Posts
    181

    Re: IP changes in Windows 2000

    hi
    u can try out timer
    i mean at regular intervals u can call the function to get IP


  4. #4
    Join Date
    Sep 1999
    Location
    TVM, Kerala, India
    Posts
    210

    Re: IP changes in Windows 2000

    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!!

  5. #5
    Join Date
    Aug 2001
    Location
    Seoul. South Korea
    Posts
    4

    Re: IP changes in Windows 2000

    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 [email protected] i will mail you that

    Hope that helps

    Cheers


    Regards

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured