[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Get IP of server application

Posted on 1998-08-30
9
Medium Priority
?
210 Views
Last Modified: 2010-04-02
I want to program a game which can play over internet. This problem is like a client/server application. For client can be connected to server, it have to know IP of server. So IP is dynamic (supply by ISP) that I have a question:
Is there any away to know IP of computer when it connect to internet?
(or Is there any ISP supply IP of users when these users access to it?
0
Comment
Question by:cdr_10
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
9 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 1171640
Internet Protocol?
See RFC 1180.
Or for the new IPv6, try RFC 1752
0
 

Author Comment

by:cdr_10
ID: 1171641
Sorry,
IP address.
0
 
LVL 1

Expert Comment

by:arbitrary
ID: 1171642
If you plan to initiate the connection yourself Using the RAS Api
you can obtain the IP or you can gethostbyname
with winsock functions like that:

hostent *pEntry;
char name[BUFFERLENGTH]
if gethostname (name,BUFFERLENGTH);
then
pEntry = *gethostbyname(name);

the trick is informing the two players of each other's IP's
U can Broadcast in LAN or use a third server which will notify
the two players of each other's server IP address.


0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:cdr_10
ID: 1171643
Thank,

Gethostname get only my IP address but I want to get IP address of other side.

I can't Broadcast in LAN because my question is: play over Internet.

How can I do with third server? Where is third server?
0
 
LVL 1

Expert Comment

by:arbitrary
ID: 1171644
it's like trying to call a phone number of someone to ask what is their phonenumber you can't do that ....
you need information service that has the IP's of the the players....
for example  my name is XXXX23234 I want to play  with 230495823
I send the server my IP address the server send it to 230495823
if 230495823 wanna play with me he can play he will send me his IP and let the game begin.
without the third server you don't have aa method  of locating this user over the internet on RT.

so I deserve my points or should I write a small program that will demonstrate it for you?

0
 

Author Comment

by:cdr_10
ID: 1171645
I'm sorry because of rejected your answer. I understood what you say but I want to know where I can find "third server". I think this server have to list all of user's IP online. Sorry because of my dulness.
Help me.
0
 
LVL 1

Expert Comment

by:arbitrary
ID: 1171646
actually the this third server should be located on a machine with a static ip / DNS file  so it could be reached .
in any case you want two people to play through the net they have to chat first,or to know they want to play with each-other,
which means that you'll need a web server to manage gatherings of people on any case you can use this server to implement this
'routing server' which it's purpose is to identify each player
or programatically -> to Identify each server to each client
through this 'routing server' is it clearer?

0
 
LVL 1

Accepted Solution

by:
arbitrary earned 400 total points
ID: 1171647
take for exapmple ICQ ....
you connect to the internet get an IP,
and then you connect to their server (icq.mirabillis.com for example)
sendnig Identity packet , and within this packet there is information s.a.  IP. etc...etc...etc...etc...
it it's still a bit vague  try reading a book about TCP/IP.

0
 

Author Comment

by:cdr_10
ID: 1171648
Thank you very much for every thing you help me.
I found what I looking for: www.mirabilis.com with ICQ.

Hope see you again.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

649 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