DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003
    South Carolina

    Question Question about Asynch Sockets Callbacks

    I am setting up a TCP Listener service that will accept mutliple connections and create a socket for each connection. I want to use a common send callback for the Async BeginSend, and a common callback for the Async BeginReceive. I will instantiate a state object for each socket that will be passed as an argument to the async functions. Since the state contains the information about which socket is being processed, a single callback function for each of the async functions makes sense; I just want to make sure that this is the best way to design this functionality, as opposed to creating a thread to manage each sockets communications.

    Is this the right way to do this?

    Thanks for all replies!
    Stephen H. Stubbs
    Software Systems Engineer
    Smith Engineering, LLC

  2. #2
    Join Date
    Jun 2004
    Asyns and threading are not the same, so I think you need to evaluate each.
    I have created a similar app using async callback AND used multiple threads. Using async callbacks, you can still block other clients while handling one client. I believe that a single-threaded app will not process multiple callbacks simultaneously but sequentially.
    Once you introduce multiple threads, make sure you understand blocking and synchronization.

Similar Threads

  1. Display one record at a time!
    By ASP learner in forum ASP.NET
    Replies: 5
    Last Post: 10-08-2002, 07:17 PM
  2. question on best programming option
    By James in forum .NET
    Replies: 2
    Last Post: 03-28-2002, 07:14 AM
    By melvin ng in forum VB Classic
    Replies: 1
    Last Post: 11-10-2000, 03:46 AM
  4. Closing Database Question
    By Kevin McGuire in forum VB Classic
    Replies: 1
    Last Post: 09-05-2000, 03:51 PM
  5. Performance question
    By John in forum VB Classic
    Replies: 2
    Last Post: 04-05-2000, 09:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.