Solved

How does ICQ know a connection was made?

Posted on 1998-11-30
11
216 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
 
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
Highfive Gives IT Their Time Back

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!

 
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
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.

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

12 Experts available now in Live!

Get 1:1 Help Now