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
  1. Home
  2. General Programming
  3. C#
  4. C# asyncallback

C# asyncallback

Scheduled Pinned Locked Moved C#
csharphelp
5 Posts 5 Posters 0 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.
  • A Offline
    A Offline
    AlexPizzano
    wrote on last edited by
    #1

    Can anyone briefly tell me how asyncallback work. How asyncallback object or variable works, especially when they are used in threading manner. Appreciate if anyone could help out

    J C D 3 Replies Last reply
    0
    • A AlexPizzano

      Can anyone briefly tell me how asyncallback work. How asyncallback object or variable works, especially when they are used in threading manner. Appreciate if anyone could help out

      J Offline
      J Offline
      Judah Gabriel Himango
      wrote on last edited by
      #2

      The AsyncCallback object is a delegate. The delegate points to a method that is called when the work finishes executing asynchronously. For example,

      Action doWorkFunction = DoSomeWork;
      doWorkFunction.BeginInvoke(OnDoWorkCompletedAsync, null);

      void DoSomeWork()
      {
      ...
      }

      void OnDoWorkCompletedAsync(IAsyncResult result)
      {
      }

      OnDoWorkComkpletedAsync will be called when DoSomeWork finishes asynchronously.

      1 Reply Last reply
      0
      • A AlexPizzano

        Can anyone briefly tell me how asyncallback work. How asyncallback object or variable works, especially when they are used in threading manner. Appreciate if anyone could help out

        C Offline
        C Offline
        Charith Jayasundara
        wrote on last edited by
        #3

        Hi, Here is a good example Regards,

        Charith Jayasundara

        L 1 Reply Last reply
        0
        • A AlexPizzano

          Can anyone briefly tell me how asyncallback work. How asyncallback object or variable works, especially when they are used in threading manner. Appreciate if anyone could help out

          D Offline
          D Offline
          Dave Sexton
          wrote on last edited by
          #4

          Here are a few links to MSDN documentation that I found helpful. Asynchronous Programming Design Patterns [^] Asynchronous Programming Using Delegates[^] Calling Asynchronous Methods Using IAsyncResult[^] I'd advise writing a simple console app to test your new found knowledge. Good luck and enjoy!

          But fortunately we have the nanny-state politicians who can step in to protect us poor stupid consumers, most of whom would not know a JVM from a frozen chicken. Bruce Pierson
          Because programming is an art, not a science. Marc Clifton

          1 Reply Last reply
          0
          • C Charith Jayasundara

            Hi, Here is a good example Regards,

            Charith Jayasundara

            L Offline
            L Offline
            leckey 0
            wrote on last edited by
            #5

            Exactly what is the example? If you are going to respond, make sure you include links, copies of code, etc.

            New feature! Scroll down to see CP offenders! Current rant: "The 50 Greatest Comedy Skits of All-Time!" http://craptasticnation.blogspot.com/[^]

            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