Solved

How to resume a hang console job due to lost network connection after the network connection is restored

Posted on 2009-04-13
1
285 Views
Last Modified: 2012-05-06
I wrote a console application that generates the reports in PDF format and exports the reports to a network share folder.  The job is written in VB.NET 2005 and scheduled to run every 2 hours.

Whenever the network connection was lost, the job will be hang until I acknowledge the error manually. Is there a way to resume the job automatically when the network connection is restored?  I used try catch clause in the code to catch the error and email the error to myself, but the email didn't send out neither due to the metwork problem.  

Thanks for help
0
Comment
Question by:jrmc-pgmr
1 Comment
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 250 total points
ID: 24298968
You can use the try catch block to handle the error even if the email can not be sent. Just put the code in try catch blocks and within the catch block, make the thread sleep for a second and then try again.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

828 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