Chapter 7: Networking and Threading

 < Day Day Up > 



Overview

In the previous chapters of this book, we've taken an in-depth look at threading in C# and .NET and discussed the various concepts and techniques associated with programming multithreaded applications. Now that you are a threading expert, we're going to build a simple multithreaded client-server application in C# and put to use some of the concepts that we have discussed thus far.

There are certain application needs for which the effective use of threads and asynchronous programming is indispensable, such as network communication, effective user interfaces, and disk input/output, to just name a few. In all these cases, a single-threaded application can freeze or appear to have crashed while it's waiting for an operation to complete. This is also true in the case of a network application where latency is often the most important criterion, especially with users that have low speed connections. In the sample application showcased in this chapter, we are going to utilize the System. Net namespace and briefly explore the networking capabilities of .NET, especially since the multi-user and asynchronous nature of network applications make them ideal candidates for threading.

In particular, we will discuss the following:

  • Developing network applications in .NET using the System. Net namespace

  • Developing a simple multithreaded client-server application based on TCP/IP

  • Using intrinsic .NET functionality to implement asynchronous operations

  • Using asynchronous message transfers between a client and a remote server



 < Day Day Up > 



C# Threading Handbook
C# Threading Handbook
ISBN: 1861008295
EAN: 2147483647
Year: 2003
Pages: 74

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net