Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *Application Start - Call Parent Thread
- Parent Thread:
- Populate Active Game Array from MS SQL
- for each item/game in our game-array
- If GameID not already running (using application level cache variable?) start a child thread for the gameid
- System.Threading.TimerCallback cb_StartBallCaller = new System.Threading.TimerCallback(GameBallCaller);
- // Create the object for the timer. Refresh Period = 5 Seconds
- clsTime objtime = new clsTime();
- bingocalltimer = new System.Threading.Timer(cb_StartBallCaller, objtime, init_waittime, REFRESH_BingoBallCalls_EVERY_SECONDS);
- if flag_UdateArrray = true - repopulate game-array from SQL)
- end for
- Child Process:
- private static void GameBallCaller(object state)
- for each Ball in a Game’s 75 ball array
- Stopwatch stopWatch = new Stopwatch();
- stopWatch.Start();
- Push the ball number to all browser
- Update database that ball has been called
- stopWatch.Stop();
- long duration = stopWatch.ElapsedMilliseconds;
- if (duration< 5000)
- sleep(5000 - duration)
- end if
- end for*
Add Comment
Please, Sign In to add comment