A method and system for providing system event notifications to clients
such as applications. Clients register for notification of one or more
types of events with a registration mechanism, and a System Event
Notification Service, (SENS), receives system event information and fires
event notifications in response thereto. A distribution mechanism
selectively communicates the fired event to each client registered for
notification thereof based on the type of event. Events include network
events, for which the service monitors the connectivity state of the
machine, including whether a connection is established or lost, the type
of connection (LAN/WAN) and bandwidth information. To monitor a LAN
state, the service caches outgoing and incoming network information
including errors and packet counts and statistically evaluates this
cached information against current information to determine whether the
connection is established or lost. The service also determines if a
destination (IP address or name) is reachable, by periodically polling
destinations. Other system event notifications may be fired, including
logon or logoff operations and power management events.