P2P-File-Sharing
README.md

P2P_File_Sharing

This is a Peer-to-Peer file sharing program that I developed in collaboration with Sloane Tribble for EECE 446, Introduction to Computer Networks. Two programs, a peer and registry binary, allow clients to join a registry and list files that can be downloaded by other peers in the registry.

Peer Program

The peer program can publish its files to the registry, search for files other peers have published, and fetch files from other peers by querying the registry for the addrinfo of the peer with the file being fetched.

Registry Program

The registry program stores peer entries containing an id, the addrinfo, socket descriptor, and publshed files for each peer. A select call is used to determine when a recv can be used to add to each socket descriptor's TCP byte stream, the change to which is used to determine the query and arguments a peer has just sent. The registry can reply to queries asking to join the registry, to publish files, or to search for the addrinfo of a peer with a specific file.