Chapter 12 Peer-to-Peer Programming

Team Fly 

Page 289

Chapter 12
Peer-to-Peer Programming

TODAY'S APPLICATIONS ACCESS RESOURCES on remote servers, and the Internet is becoming an extended network that allows us to reach any computer (almost) as if it belonged to our local area network. We want to access information wherever it exists—retrieve the most up-to-date information and process it as needed, and where it's needed. New technologies, such as Web services, allow us to easily expose information to other systems, or consume information from remote systems.

Even Web applications are not always limited to a browser connected to a web server. You can write a Windows application that contacts a web server and downloads one or more files to process locally. It's also possible to upload files to the web server, as long as you specify the name of an application that runs on the server and knows what to do with the uploaded files.

The .NET Framework provides a number of tools for exposing objects to remote systems, as well as for consuming objects on remote systems. In addition to the new tools, Microsoft has enhanced the traditional tools for peer-to-peer programming. Sometimes we don't need to expose our data to the world, just to specific remote systems. To enable two computers to talk to each other, you must use the System.Net namespace, which exposes the required functionality. In this chapter we explore the System.Net namespace and we show examples of peer-to-peer programming. You'll see how to write applications that run on two different computers, contact one another, and execute commands on the remote computer. These applications are written in pairs and they allow you to determine how the two computers will exchange information. You can use your own encryption techniques to protect your data, use custom authentication techniques, and have complete control over the flow of data between the two machines.

Internet Addressing

Before we start our exploration of sockets and peer-to-peer programming, we'll briefly discuss the System.Net.Dns class, which simplifies the task of addressing computers on the Internet. You're probably familiar with the topics of this section, but we'll repeat a few basic terms for the sake of VB programmers who are new to Internet programming.

Every computer on the Internet is identified by a unique address, known as the IP address. The IP address is a long number that is written as a group of four numbers, each one in the range of 0

Team Fly 


Visual Basic  .NET Power Tools
Visual Basic .NET Power Tools
ISBN: 0782142427
EAN: 2147483647
Year: 2003
Pages: 178

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