finding the local IP address without socket connection?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • crypto_stonelock@sympatico.ca

    finding the local IP address without socket connection?

    Hello,

    I was wondering if anybody knew how to retrieve the IP address attributed
    dynamically by your ISP without having to use the info collected
    on a socket with say .getLocalAddres s.

    I'm using dsl with PPPoE and whenever i try to get the local address,
    through InetAddress, the network address is returned. So i'm guessing that
    InetAddress is out.My network is in the way and i don't think i can really go
    around it. I can't seem to find any class that could help me out.

    Any ideas?
    Thanks in advance
    Stonelock
  • Amey Samant

    #2
    Re: finding the local IP address without socket connection?

    hi
    not a good solution but definitely workaround one.
    you can use exec to get all ipaddress using say "ipconfig -all" on win
    platform & then parse the output
    u can try this if nuthin else works or you need quick workaround soln
    ;)

    regards
    amey


    crypto_stoneloc k@sympatico.ca wrote in message news:<b1753641. 0401191502.3c27 8032@posting.go ogle.com>...[color=blue]
    > Hello,
    >
    > I was wondering if anybody knew how to retrieve the IP address attributed
    > dynamically by your ISP without having to use the info collected
    > on a socket with say .getLocalAddres s.
    >
    > I'm using dsl with PPPoE and whenever i try to get the local address,
    > through InetAddress, the network address is returned. So i'm guessing that
    > InetAddress is out.My network is in the way and i don't think i can really go
    > around it. I can't seem to find any class that could help me out.
    >
    > Any ideas?
    > Thanks in advance
    > Stonelock[/color]

    Comment

    • crypto_stonelock@sympatico.ca

      #3
      Re: finding the local IP address without socket connection?

      Yeah i guess so but i was looking for a friendly and portable java
      related solution of course ;}.
      Right now, i'm using the method of connecting to www.yahoo.com on port
      80 to get my own ip address
      from the resulting temporary socket; its alright but i'd like to be
      able to determine the same address
      without having to involve a third party like im doing right now. In
      that case, the InetAddress class seems
      inadequate and so is the InetSocketAddre ss (which im using right now)
      since it involves
      a connected socket.

      Any other idea?
      Stonelock

      ameyas7@yahoo.c om (Amey Samant) wrote in message news:<669e50b8. 0401200936.1f01 2478@posting.go ogle.com>...[color=blue]
      > hi
      > not a good solution but definitely workaround one.
      > you can use exec to get all ipaddress using say "ipconfig -all" on win
      > platform & then parse the output
      > u can try this if nuthin else works or you need quick workaround soln
      > ;)
      >
      > regards
      > amey
      >
      >
      > crypto_stoneloc k@sympatico.ca wrote in message news:<b1753641. 0401191502.3c27 8032@posting.go ogle.com>...[color=green]
      > > Hello,
      > >
      > > I was wondering if anybody knew how to retrieve the IP address attributed
      > > dynamically by your ISP without having to use the info collected
      > > on a socket with say .getLocalAddres s.
      > >
      > > I'm using dsl with PPPoE and whenever i try to get the local address,
      > > through InetAddress, the network address is returned. So i'm guessing that
      > > InetAddress is out.My network is in the way and i don't think i can really go
      > > around it. I can't seem to find any class that could help me out.
      > >
      > > Any ideas?
      > > Thanks in advance
      > > Stonelock[/color][/color]

      Comment

      • crypto_stonelock@sympatico.ca

        #4
        Re: finding the local IP address without socket connection?

        Yeah i guess so but i was looking for a friendly and portable java
        related solution of course ;}.
        Right now, i'm using the method of connecting to www.yahoo.com on port
        80 to get my own ip address
        from the resulting temporary socket; its alright but i'd like to be
        able to determine the same address
        without having to involve a third party like im doing right now. In
        that case, the InetAddress class seems
        inadequate and so is the InetSocketAddre ss (which im using right now)
        since it involves
        a connected socket.

        Any other idea?
        Stonelock

        ameyas7@yahoo.c om (Amey Samant) wrote in message news:<669e50b8. 0401200936.1f01 2478@posting.go ogle.com>...[color=blue]
        > hi
        > not a good solution but definitely workaround one.
        > you can use exec to get all ipaddress using say "ipconfig -all" on win
        > platform & then parse the output
        > u can try this if nuthin else works or you need quick workaround soln
        > ;)
        >
        > regards
        > amey
        >
        >
        > crypto_stoneloc k@sympatico.ca wrote in message news:<b1753641. 0401191502.3c27 8032@posting.go ogle.com>...[color=green]
        > > Hello,
        > >
        > > I was wondering if anybody knew how to retrieve the IP address attributed
        > > dynamically by your ISP without having to use the info collected
        > > on a socket with say .getLocalAddres s.
        > >
        > > I'm using dsl with PPPoE and whenever i try to get the local address,
        > > through InetAddress, the network address is returned. So i'm guessing that
        > > InetAddress is out.My network is in the way and i don't think i can really go
        > > around it. I can't seem to find any class that could help me out.
        > >
        > > Any ideas?
        > > Thanks in advance
        > > Stonelock[/color][/color]

        Comment

        • Amey Samant

          #5
          Re: finding the local IP address without socket connection?

          hi
          have you checked java.net.Networ kInterface class ?
          you can print details of your network card.
          regards
          amey

          Comment

          • Amey Samant

            #6
            Re: finding the local IP address without socket connection?

            hi
            have you checked java.net.Networ kInterface class ?
            you can print details of your network card.
            regards
            amey

            Comment

            • crypto_stonelock@sympatico.ca

              #7
              Re: finding the local IP address without socket connection?

              Ahhhh!!! Wonderful

              I wasn't aware of the existence of this class. Thanks a bunch for the info. This
              should do the trick.

              Thanks again :).
              Stonelock


              ameyas7@yahoo.c om (Amey Samant) wrote in message news:<669e50b8. 0401220534.6cef 92b7@posting.go ogle.com>...[color=blue]
              > hi
              > have you checked java.net.Networ kInterface class ?
              > you can print details of your network card.
              > regards
              > amey[/color]

              Comment

              • crypto_stonelock@sympatico.ca

                #8
                Re: finding the local IP address without socket connection?

                Ahhhh!!! Wonderful

                I wasn't aware of the existence of this class. Thanks a bunch for the info. This
                should do the trick.

                Thanks again :).
                Stonelock


                ameyas7@yahoo.c om (Amey Samant) wrote in message news:<669e50b8. 0401220534.6cef 92b7@posting.go ogle.com>...[color=blue]
                > hi
                > have you checked java.net.Networ kInterface class ?
                > you can print details of your network card.
                > regards
                > amey[/color]

                Comment

                Working...