Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. how to create multiple timers

how to create multiple timers

Scheduled Pinned Locked Moved C#
sysadmintutorialquestion
2 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    batmanAgen
    wrote on last edited by
    #1

    hi guys, in my client/server application, i have a list in my server of connected clients. if the physical connection of the network is dropped, i would like to start a timer in the server app that will count up to lets say 2 minutes and by that time if the client still did not respond i would like to remove that client from the list. how will i create multiple timers to monitor each of my clients? or if you can suggest a better way of doing this, i accept suggestions. thnx

    C 1 Reply Last reply
    0
    • B batmanAgen

      hi guys, in my client/server application, i have a list in my server of connected clients. if the physical connection of the network is dropped, i would like to start a timer in the server app that will count up to lets say 2 minutes and by that time if the client still did not respond i would like to remove that client from the list. how will i create multiple timers to monitor each of my clients? or if you can suggest a better way of doing this, i accept suggestions. thnx

      C Offline
      C Offline
      CWIZO
      wrote on last edited by
      #2

      You don't need multiple timers. Just use one set it's interval to one second... Then have a list of connected users with a property that stores the time of last action, you then go trough that list comparing current time with that time every time the timer ticks and do your logic there... Q:What does the derived class in C# tell to it's parent? A:All your base are belong to us!

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups