Thursday, January 22, 2009

10. peer to peer connection
The PeerConnection module encapsulates a socket connected to a peer node. The framework currently uses TCP/IP sockets for communication between nodes. A PeerConnection object provides methods the make it easy for the programmer to send and receive messages and acknowledgments in the P2P algorithm. It ensures messages are encoded in the correct format and attempts to detect various error conditions.
The Peer module manages the overall operations of a single node in the P2P network. It contains a main loop that listens for incoming connections and creates separate threads to handle them. The programmer, building a P2P protocol on top of this generic framework, would registers handlers (i.e. methods or functions) with the Peer module for various message types, and the main loop would dispatch incoming requests to the appropriate handler.
Peer-to-peer (P2P) networking eliminates the need for central servers, allowing all computers to communicate and share resources as equals. Music file sharing, instant messaging and other popular network applications rely on P2P technology. So if a computer is advertising that it has music available by allowing people to connect to it, people can find out the IP address of the computer. Because your Internet service provider knows who has which IP addresses, it is ultimately possible to find out who you are. This is how the RIAA tracks down the people it sues for sharing music.
The physical or wireless connections of the computers, you can electronically connect them, test or check that they can "see" each other. Microsoft Windows XP makes networking ridiculously easy. In fact, when writing these lessons, after physically connecting the computers to the router and turning everything on, the whole network had been built and there was no particularly necessary configuration to perform: everything was ready.

No comments:

Post a Comment