Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 68825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:28:37+00:00 2026-05-10T19:28:37+00:00

I am working on a windows service that polls for a connection to a

  • 0

I am working on a windows service that polls for a connection to a network enabled devices every 15 seconds. If the service is not able to connect to a device, it throws an exception and tries again in 15 seconds. All of this works great.

But, lets say one of the devices is down for a day or more. I am filling up my exception log with the same exception every 15 seconds. Is there a standard way to prevent an exception from being written to the event log if the exception being thrown hasn’t changed in the last x number of hours?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T19:28:38+00:00Added an answer on May 10, 2026 at 7:28 pm

    One good way to achieve what you need is to employ the Circuit Breaker design pattern.

    I first read about this in the book ‘Release It! Design and Deploy Production Ready Software’ by Michael T. Nygard, from the Pragmatic Press, p104-107.

    The idea of the circuit breaker is that it sits in the path of the connection between systems, passing connections through, watching for the ‘break condition’. For example, it might trigger only if five connections in a row have all failed.

    Once the circuit has broken, all calls through the circuit breaker fail immediately, without consulting the external service. This continues until a timeout occurs, when the breaker goes into a half-open state. The next call is attempted – a failure results in the timeout being reset, success in the breaker closing and the system resuming operation.

    A quick google found a post by Tim Ross that reads well and goes into more detail.

    In your case, you could use a circuit breaker with a timeout of 10 minutes, and a trigger of 5 failures. Your log files would then contain, in the case of an all day failure, five exceptions logged for the original problem, and then just six more an hour (compared with 240 at 15 second intervals), indicating that the problem persists.

    Depending on your requirements, you could include a manual ‘reset’ of the circuit breaker, or you could just leave it to automatically reset when the 10 minute timeout reveals things are back to normal. This could be useful – generally the fewer things the sysadmins need to fuss with, the better they like it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a windows service that sends email reminders every 30 seconds. 10
I'm working with an n-Tier application using WinForm and WCF Engine Service (Windows Service)
I am writing a Windows service that pulls messages from an MSMQ and posts
Hi I am trying to implement a windows service that subscribes and publishes to
I have a windows Service that start some tasks based on a configuration. Each
I'm working on a web service that is basically a wrapper around an Oracle
Occasionally working in Windows Vista the O.S. will desaturate the screen, rendering all colors
i'm working on windows mobile app (c#, .net 2.0). i would like to make
I am working on Windows Server 2003 (IIS6), which has two asp.net sites running
I have an Open Source app and I have it working on Windows, Linux

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.