How PeerCast Works

Now that you've seen what PeerCast does, let's explain the technology that makes PeerCast work, including:

  • How Peer Channel applications work

  • Building the NetworkManager class

  • Listening to P2P events using Network Manager

  • Understanding how the login process works

  • Understanding how chat messages work

  • Understanding how video streaming works

  • Building the MainWindow.xaml UI

  • Adding the MainWindow.xaml code

How Peer Channel Applications Work

Before we get into any code, we need to explain, at a high level, how Peer Channel applications work.

Key P2P terms

This chapter is written assuming you have no previous experience building P2P applications, and so we'll start off by explaining the key terminology used in P2P applications:

C4FP2P

An abbreviation for the Coding4Fun peer-to-peer library that provides a wrapper of the Peer Channel protocol.

Mesh

An ad-hoc network of nodes with the same mesh name. When you run PeerCast, you'll enter a network name and password, which will create a custom mesh. The term "mesh" in this context has no relation to Microsoft Live Mesh.

NetPeerTcpBinding

A Windows Communication Foundation (WCF) class that implements the Peer Channel protocol.

Node

A computer, device, or application that uses the Peer Channel protocol. Any PC running PeerCast would be considered a node.

Peer-to-peer (P2P)

P2P applications use decentralized communication where clients communicate amongst peers instead of communicating to a central server.

Peer Channel

A protocol for building ...

Get Coding4Fun now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.