Timeout exception in threading
I have implemented threading to call 5 methods to send different email notifications through windows services. It is throwing timeout exception every time. Please suggest me if is there any way to fix this issue.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Mohan ArumugamRank #5,109 · 311 reputationPosted Apr 19, 2018, 3:53 AM EDT
class Program {static void DoSomething() {try {// your call here...} catch (ThreadAbortException) {// cleanup code, if needed...public static void Main(params string[] args) {Thread t = new Thread(DoSomething);if (!t.Join(TimeSpan.FromSeconds(30))) {throw new Exception("More than 30 secs.");Imran AhmedRank #7,080 · 249 reputationPosted Apr 19, 2018, 4:32 AM EDT
Imran AhmedRank #7,080 · 249 reputationPosted Apr 19, 2018, 4:39 AM EDT