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
Solved

Get IP of server application

Posted on 1998-08-30
9
205 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
  • 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 

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 100 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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to convert MFC APP to Win32 APP. 19 94
c++ syntax question 9 52
Problem with SqlConnection 4 178
VS2015 Redefinition errors 4 70
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

828 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