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. Asynchronous Vs Multithreaded Client-Server ? [modified]

Asynchronous Vs Multithreaded Client-Server ? [modified]

Scheduled Pinned Locked Moved C#
csharpcssvisual-studiosysadminquestion
5 Posts 3 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.
  • Z Offline
    Z Offline
    zinc_z
    wrote on last edited by
    #1

    Hi , I am developing a Client-Server application , I have done some research and found there are three ways to handle multiple client requests. 1. To use old style multithreaded server 2. To use .NET threadPoll worker threads 3. Asynchronous Socket programing But I am confused that which appproch I shld go.... ? :confused: My clients will run and provide all local info to main application ( Server ) so its the clients who actually will provide info to server/the Main Monitoring application(server) . Any guidence please to which approch I shd go ? Clients will be less than 50 ... and the Info they will provide on based on Events generated by Server. Thanks in advance. ZINK -- modified at 8:46 Saturday 3rd March, 2007

    HELLO

    P P 2 Replies Last reply
    0
    • Z zinc_z

      Hi , I am developing a Client-Server application , I have done some research and found there are three ways to handle multiple client requests. 1. To use old style multithreaded server 2. To use .NET threadPoll worker threads 3. Asynchronous Socket programing But I am confused that which appproch I shld go.... ? :confused: My clients will run and provide all local info to main application ( Server ) so its the clients who actually will provide info to server/the Main Monitoring application(server) . Any guidence please to which approch I shd go ? Clients will be less than 50 ... and the Info they will provide on based on Events generated by Server. Thanks in advance. ZINK -- modified at 8:46 Saturday 3rd March, 2007

      HELLO

      P Offline
      P Offline
      Parwej Ahamad
      wrote on last edited by
      #2

      (1) You can use socket programming. Open a port of Server and each client send data on that port with self identification. (2) Handled the each client in thread.......

      Parwej Ahamad g_parwez@rediffmail.com

      Z 1 Reply Last reply
      0
      • P Parwej Ahamad

        (1) You can use socket programming. Open a port of Server and each client send data on that port with self identification. (2) Handled the each client in thread.......

        Parwej Ahamad g_parwez@rediffmail.com

        Z Offline
        Z Offline
        zinc_z
        wrote on last edited by
        #3

        Yeh I know that , but my question was which technique I shd use ? and why ? because I have seen some exampls of client-server written using Asynch methods and it looks very easy n good , but not sure how much stable and efficent it is ... So please any one who knos the diff between these 3 techniques and reason... ?

        HELLO

        P 1 Reply Last reply
        0
        • Z zinc_z

          Yeh I know that , but my question was which technique I shd use ? and why ? because I have seen some exampls of client-server written using Asynch methods and it looks very easy n good , but not sure how much stable and efficent it is ... So please any one who knos the diff between these 3 techniques and reason... ?

          HELLO

          P Offline
          P Offline
          Parwej Ahamad
          wrote on last edited by
          #4

          As per the developers opinion Asynchronous is best way to developed client-server architecture. Because Asynchronous sockets use multiple threads from the system thread pool to process network connections. One thread is responsible for initiating the sending or receiving of data; other threads complete the connection to the network device and send or receive the data. If you would like to get some example please find below link......... http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconUsingNon-blockingClientSocket.asp

          Parwej Ahamad g_parwez@rediffmail.com

          1 Reply Last reply
          0
          • Z zinc_z

            Hi , I am developing a Client-Server application , I have done some research and found there are three ways to handle multiple client requests. 1. To use old style multithreaded server 2. To use .NET threadPoll worker threads 3. Asynchronous Socket programing But I am confused that which appproch I shld go.... ? :confused: My clients will run and provide all local info to main application ( Server ) so its the clients who actually will provide info to server/the Main Monitoring application(server) . Any guidence please to which approch I shd go ? Clients will be less than 50 ... and the Info they will provide on based on Events generated by Server. Thanks in advance. ZINK -- modified at 8:46 Saturday 3rd March, 2007

            HELLO

            P Offline
            P Offline
            pbraun
            wrote on last edited by
            #5

            If your application is not a real time control application, then you can ignore any time dependencies. However, if your application is a real time control application, then you will want to consider asynchronous as being your top candidate. Please note that if you use Asynchronous socket programming, you will be using the thread pool anyway. That's how delegate calls work. It is also the case that the timers in .Net use thread pool threads. Some problems that are apparent with thread pool threads are that control over the state of a thread pool thread is not easily available. Please be careful when using them. You also need to ensure that code called by the thread pool reports when an error occurs. Throwing an exception may only cause the thread to terminate and not cause the exception to be caught in a place where it can be handled properly. Phil

            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