Skip to content

Server Information

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

This page contains information about the server side of the IRC

High-Level Overview

  1. Create a socket object
  2. Create a server socket object
  3. Create an instance of a lobby (limited to 1 lobby)
  4. Upon successful server setup continuously loop

5a. Wait for a client to communicate with the server (3 possible scenarios)

Scenario #1: The client is new to the server (client's first time connecting)

  1. Accept the connection from client
  2. Create a client object
  3. Add the client object to the connection list
  4. Welcome the client to the server

Scenario #2: The client is know to the server, so handle the message

  1. Receive the message from the client
  2. Decode and normalize the message to lowercase
  3. Handle the message

Scenario #3: The client sent a null (junk) message

  1. Receive the message from the client
  2. Close the clients connection
  3. Remove the client from the connection list

5b. Wait for an error to occur

  1. Close the clients socket
  2. Remove the client from the connection list

Clone this wiki locally