Solved

A question about getAddress()

Posted on 1998-07-14
3
174 Views
Last Modified: 2010-03-30
These sentences in Visual J++ 1.0 help:
"InetAddress getAddress()

Returns:
the IP address (§4.4) of the machine to which this datagram is being sent, or from which the datagram was received."

what does it mean the destination IP or the source IP?
Thanks.
0
Comment
Question by:tungsim
  • 2
3 Comments
 
LVL 5

Expert Comment

by:msmolyak
ID: 1226327
The InetAddress object represents an IP address. Whose address it is depends on how you obtained that object.

Example
// This is the address of the machine where the program is running
InetAddress addr = InteAddress.getLocalHost();
byte[] byteAddr = addr.inetAddress();
0
 
LVL 1

Accepted Solution

by:
dryang earned 50 total points
ID: 1226328
getAddress() is to obtain the address of the local machine
getInetAddress() is to get the address of the remote machine
0
 
LVL 1

Expert Comment

by:dryang
ID: 1226329
oops forgot the second part
source IP is the address where a request originates
destination IP is he address where the request gets sent to.
The source IP does not need to be the local machine, nor the destination IP a remote machine. It can be the other way round
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now