Solved

How does ICQ know a connection was made?

Posted on 1998-11-30
11
221 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
Independent Software Vendors: 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 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
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.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

733 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