Results 1 to 10 of 10

Thread: ip change

  1. #1
    iiggoorr is offline Member
    Join Date
    Nov 2008
    Posts
    5
    Rep Power
    0

    Default ip change

    Hy
    I am wondering is it possible to create application that is sensitive to IP change meaning it perform some action when IP is changed?

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,589
    Rep Power
    23

    Default

    What do you mean by IP?
    How/when does an IP change?

  3. #3
    iiggoorr is offline Member
    Join Date
    Nov 2008
    Posts
    5
    Rep Power
    0

    Default

    I mean IP adress sorry, i didn't explane that at first.
    my Internet provider is changing IP addresses from time to time so we couldn't establish server over ADSL :).

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,589
    Rep Power
    23

    Default

    The InetAddress class might help you get your IP address.

  5. #5
    iiggoorr is offline Member
    Join Date
    Nov 2008
    Posts
    5
    Rep Power
    0

    Default

    Well thx for trying, but InetAdress class is not what i need, actually my computer is behind NAT/Router so it has 192.168.x.x address and i need Router IP address. I now how to get that address, what i don't know is how to make application sensitive to it...
    I guess what i want is one threat that is "sniffing" IP address of the router constantly, and another threat with main program. What i don't know is: can I make threat with main program listen to response from IP checking threat, without having to check shared variable from time to time...

    I guess it is not so much network question any more, but... :)

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,589
    Rep Power
    23

    Default

    can I make thread with main program listen to response from IP checking thread, without having to check shared variable
    You could use a callback routine that the IP checking thread would call when it found a change. What would be the main program's response when the IP address changed?

  7. #7
    RoyArtelo is offline Member
    Join Date
    Nov 2008
    Location
    USA
    Posts
    1
    Rep Power
    0

    Default final argument against Obama

    Do you think that Obama is going to win because the Republicans have such a bad candidate?
    Why did John McCain make his final argument against Obama... coal?
    That's his closing argument? William Ayers, Rev. Wright, spreading the wealth, Born Alive, meeting dictators without preconditions, etc. all have to take a back seat so that McCain can go to Colorado and New Mexico to talk about coal? Does this more or less explain why he's going to get his clock cleaned Tuesday?

  8. #8
    iiggoorr is offline Member
    Join Date
    Nov 2008
    Posts
    5
    Rep Power
    0

    Default

    the main program would be JXTA peer, and it would need to restart JXTA after IP has changed

  9. #9
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,589
    Rep Power
    23

    Default

    Can that be done by a method, ie the call back?

  10. #10
    iiggoorr is offline Member
    Join Date
    Nov 2008
    Posts
    5
    Rep Power
    0

    Default

    yes it can be done with method, but, i'll need to learn what is callback method, and how is it implemented :). As I understood basicly call back function is function which is passed as a parameter to another function, so the other function can call it. Am i right? BTW as i understood i pass callback function as a reference, but will the call work from threat, especially since my callback would be method in another thread class instance.
    Last edited by iiggoorr; 11-05-2008 at 07:20 PM.

Similar Threads

  1. How to change JDK?
    By mew in forum Eclipse
    Replies: 5
    Last Post: 05-21-2010, 05:21 AM
  2. How to change The Font
    By kader in forum New To Java
    Replies: 2
    Last Post: 09-15-2008, 04:09 AM
  3. How ro change the locale of JVM
    By ravi.ks007@hotmail.com in forum Advanced Java
    Replies: 2
    Last Post: 12-26-2007, 06:17 AM
  4. Change my for loop
    By javaplus in forum New To Java
    Replies: 4
    Last Post: 12-12-2007, 11:00 AM
  5. Is it possible to change the '\n' into ' ' ...
    By johnny7white in forum New To Java
    Replies: 1
    Last Post: 11-15-2007, 02:32 PM

Posting Permissions

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