LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-07-2003, 05:14 AM   #1
juby
Member
 
Registered: Dec 2002
Location: Bangalore, India
Distribution: Ubuntu 5.*
Posts: 241

Rep: Reputation: 30
Question get teh actual ipaddress in a dial up connection , Java


Hi can ne one tell how to get the actual ip address of a machine connected with that of mine when the session is established thru a dialup .. type connection.. ie when the ip address is dynamic.. i use socket pgmg in java .. any links , suggesions ?
 
Old 04-08-2003, 12:58 PM   #2
acjt
Member
 
Registered: Dec 2002
Location: Australia
Distribution: Gentoo
Posts: 161

Rep: Reputation: 30
Did you have a poke about in the java.net package? All that you should need to use is in there.
 
Old 04-26-2003, 05:12 AM   #3
juby
Member
 
Registered: Dec 2002
Location: Bangalore, India
Distribution: Ubuntu 5.*
Posts: 241

Original Poster
Rep: Reputation: 30
Ya i pocked thru it but cudnt find much.. is there any way to perform naming look up using java ?
 
Old 04-26-2003, 07:06 AM   #4
Looking_Lost
Senior Member
 
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120

Rep: Reputation: 45
import java.net.*;

public class IPLookup
{
public static void main(String args[])
{
try
{
InetAddress host;
host=InetAddress.getByName("www.yahoo.com");


System.out.println("Host IP address is " + host.getHostAddress());

}catch(UnknownHostException e)
{
System.out.println("Unable to find host");
}
}
}


There's the basic's for resolving a name to IP, you should be able to adapt

Take a look at the InetAddress class.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
java.lang.InstantiationException: java.sql.Connection poeta_boy Programming 2 07-06-2005 08:26 PM
Dial up using JAVA nedian123 Programming 1 08-15-2004 03:33 PM
dial up connection jobs General 2 05-20-2003 06:17 AM
Dial-Up Connection on RH 8 djhurt1 Linux - Newbie 1 04-14-2003 06:40 AM
Java, dial-up connection and Linux Sharmila Inamdar Linux - Networking 2 07-20-2001 03:12 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration