Solved

How does ICQ know a connection was made?

Posted on 1998-11-30
11
220 Views
Last Modified: 2010-04-01
I can see that the ICQ program has an agent that "knows"
when a network connection was made (through dial-up,LAN etc.).
How do they do that (from their source code)?
Thanks.
0
Comment
Question by:gilbert_chang
  • 5
  • 2
  • 2
  • +2
11 Comments
 
LVL 6

Expert Comment

by:thresher_shark
ID: 1178894
I don't know how THEY do it.  I suspect they just continually try to ping a server (like mirabilis.com) until it is successful.  Then ICQ connects.  If you want source code for pinging a server, I think I can provide it.
0
 

Author Comment

by:gilbert_chang
ID: 1178895
I would appreciate it.
Thanks.
0
 
LVL 5

Expert Comment

by:yonat
ID: 1178896
No, they use the RAS API. Take a look at RasConnectionNotification API function.
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

 
LVL 6

Expert Comment

by:thresher_shark
ID: 1178897
It looks like yonat's solution is better, but in case you want a ping sample, go here:

http://www.codeguru.com/network/ping.shtml
0
 

Expert Comment

by:darklight
ID: 1178898
What about for MFC ?
0
 
LVL 5

Expert Comment

by:yonat
ID: 1178899
What about it? This is a simple API function, not something you need a class wrapper for.
0
 
LVL 5

Accepted Solution

by:
yonat earned 50 total points
ID: 1178900
The API function RasConnectionNotification() will allow you to be notified when a connection is made.
0
 

Author Comment

by:gilbert_chang
ID: 1178901
RasConnectionNotification() only lets me know when a new RAS connection is made. What about other connections (Not dial-up),
Such as LAN connections?
Thanks.
0
 
LVL 5

Expert Comment

by:yonat
ID: 1178902
You'll need to write a WinSock "Layered Service Provider" for that. This is much more complicated. If you really want to do that, see http://www.sockets.com/winsock2.htm .
0
 
LVL 5

Expert Comment

by:yonat
ID: 1178903
BTW, ICQ does use RasConnectionNotification() (I know some people from Mirabilis...)
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1178904
Bought This Question.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

Suggested Solutions

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
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 clear a vector as well as how to detect empty vectors in C++.

790 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