Skip to content

Client Information

Dustin Schnelle edited this page May 26, 2018 · 2 revisions

This page contains information about the client side of the IRC

High-Level Overview

  1. Check sure host argument was input by user
  2. Create a socket object
  3. Create a client socket object
  4. Upon successful client setup continuously loop
  5. Add the client to the connection list
  6. Wait for the server to communicate (2 possible scenarios)

Scenario #1: The current client is not the one sending the message to the server

Scenario #2: The current client is the one send the message to the server

7a. The current client is not sending the message

  1. Receive the message from the server (2 possible scenarios)

Scenario #1.1: The received message in not valid

Scenario #1.2: The received message is valid

9a. Invalid message from the server

  1. Gracefully exit the program (Server disconnected)

9b. Valid message from the server (3 possible scenarios)

Scenario #1.2.1: Quit message received from the server

Scenario #1.2.2: Clients first communication and is unknown to the server

Scenario #1.2.3: Client is know to the server

10a. Gracefully exit the program (Client leaving)

10b. Write to the client's output terminal

  1. Prompt the client for their name

10c. Write to the client's output terminal

  1. Prompt the client

7b. The current client is sending the message

  1. Send the message to the server

Clone this wiki locally