Introduction
There is much excitement about the Internet and the Web. The Internet ties the information world together. The Web makes the Internet easy to use and gives it the flair and sizzle of multimedia. Organizations see the Internet and the Web as crucial to their informationsystems strategies. The .NET FCL provides a number of built-in networking capabilities that make it easy to develop Internet- and Web-based applications. Programs can search the world for information and collaborate with programs running on other computers internationally, nationally or just within an organization.
In Chapter 21, ASP.NET 2.0, Web Forms and Web Controls, and Chapter 22, Web Services, we began our presentation of C#'s networking and distributed-computing capabilities. We discussed ASP.NET, Web Forms and Web serviceshigh-level networking technologies that enable programmers to develop distributed applications. In this chapter, we focus on the underlying networking technologies that support C#'s ASP.NET and Web services capabilities.
This chapter begins with an overview of the communication techniques and technologies used to transmit data over the Internet. Next, we present the basic concepts of establishing a connection between two applications using streams of data that are similar to File I/O. This connection-oriented approach enables programs to communicate with one another as easily as writing to and reading from files on disk. Then we present a simple chat application that uses these techniques to send messages between a client and a server. The chapter continues with a presentation and an example of connectionless techniques for transmitting data between applications that is less reliable than establishing a connection between applications, but much more efficient. Such techniques are typically used in applications such as streaming audio and video over the Internet. Next, we present an example of a client-server Tic-Tac-Toe game that demonstrates how to create a simple multithreaded server. Then this chapter demonstrates the new WebBrowser control for adding Web browsing capabilities to any application. The chapter completes with a brief introduction to .NET remoting which, like Web services (Chapter 22) enable distributed computing over networks.