Solved

How does ICQ know a connection was made?

Posted on 1998-11-30
11
219 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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

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…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

832 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