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