Description
This is a team-based (max. 2) assignment. We’ve all played the game, “Rock Paper Scissors” (RPS). For this assignment, we will be building a RPS server we can netcat into. This will be dual-client only (i.e., two people can play at a time). Additionally, it should support Zeroconf/Bonjour. How will you find the port information for your RPS game? It should use Zeroconf to register itself. Subsequently, you should be able to find the information about your service by resolving it. Make sure you can see this information appear on your Zeroconf browser. Please only use the “local” domain. During development the type of your server should be “_rps._tcp”. For the name, you should use your RCS/CS username. Unlike most iterative servers, this one will require the use of the select() system call due to the requirement of Zeroconf/Bonjour. The sample code from the Zeroconf book and 6.21/6.22 of our textbook may be helpful. The server should not exit upon finishing game. Instead, if should continue to wait for additional client connections. Input should be checked and validated when possible. For example, a name consisting solely of whitespace (as indicated by a function such as isspace()) should be treated as invalid. An item outside the set {rock, paper, scissors} would also be considered invalid. Example output below. User input is in bold. $ dns-sd -L laprej _rps._tcp local Lookup laprej._rps._tcp.local DATE: —Wed 28 Feb 2018— 0:18:24.402 …STARTING… 0:18:24.403 laprej._rps._tcp.local. can be reached at loki.local.:58336 (interface 8) ^C $ nc localhost 58336 What is your name? What is your name? bob Rock, paper, or scissors? potato Rock, paper, or scissors? roCk PAPER covers ROCK! JUSTIN defeats BOB! $ nc localhost 58336 What is your name? bob Rock, paper, or scissors? 1 scissors ROCK smashes SCISSORS! JUSTIN defeats BOB! Meanwhile, on another terminal, Justin saw this: nc localhost 58336 What is your name? justin Rock, paper, or scissors? paper PAPER covers ROCK! JUSTIN defeats BOB! $ nc localhost 58336 What is your name? justin Rock, paper, or scissors? rock ROCK smashes SCISSORS! JUSTIN defeats BOB! 2

