How does ICQ know a connection was made?

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.
gilbert_changAsked:
Who is Participating?
 
yonatConnect With a Mentor Commented:
The API function RasConnectionNotification() will allow you to be notified when a connection is made.
0
 
thresher_sharkCommented:
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
 
gilbert_changAuthor Commented:
I would appreciate it.
Thanks.
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
yonatCommented:
No, they use the RAS API. Take a look at RasConnectionNotification API function.
0
 
thresher_sharkCommented:
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
 
darklightCommented:
What about for MFC ?
0
 
yonatCommented:
What about it? This is a simple API function, not something you need a class wrapper for.
0
 
gilbert_changAuthor Commented:
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
 
yonatCommented:
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
 
yonatCommented:
BTW, ICQ does use RasConnectionNotification() (I know some people from Mirabilis...)
0
 
MirkwoodCommented:
Bought This Question.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.