?
Solved

How does ICQ know a connection was made?

Posted on 1998-11-30
11
Medium Priority
?
223 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
[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
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
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 viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses
Course of the Month10 days, 4 hours left to enroll

762 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