C#C
C#3y ago
28 replies
LordoToasty

Timer, devideFound and Background Thread!

Hi and thank you for coming to try to help me. I have my code done and working already, but there is on thing bothering me about it, related to the Title of this post.
My problem is, that I want to call "DeviceFound" (Mono.nat lib) every 120s due to the expiration of the port forward being 120s. I tried making a timer which will repeat the deviceFound every two minutes, but it didn't work, the same for creating a new thread, as all the treads will get blocked due to the last one being always active and the program not wanting to do anything till it is exited, but that would mean a restart of the server, which is the thing I want to avoid, I added the related Code down below, excluding the timer and thread I have tried making. I really appreciate any kind of help!
Was this page helpful?