Skip to content

Client-Server chat room service realized as a socket programming and networking exercise

Notifications You must be signed in to change notification settings

andrea-covre/client-server-live-chat-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Client-Server Live Chat Service

OVERVIEW

Title: Client-Server Live Chat Service
Author: Andrea Covre
Email: andrea.covre@icloud.com
Date: March 10th, 2021

This service was realized as a socket programming and networking exercise.

DEMO

Server DEMO by Andrea Covre Client 1 DEMO by Andrea Covre Client 2 DEMO by Andrea Covre Client 3 DEMO by Andrea Covre

SHORTCUTS CODES

  • :) → [feeling happy]
  • :( → [feeling sad]
  • :mytime → current time
  • :+1hr → current time plus one hour
  • :Exit → exit the chat

Shortcuts codes DEMO by Andrea Covre

FILES INCLUDED

  • chatclient.h header file for the chat client (C)

  • chatclient.c source file for the chat client (C)

  • chatserver.h header file for the chat server (C)

  • chatserver.c source file for the chat server (C)

  • Makefile file to compile the executable server and client files

  • README.md documentation with description, images and instructions

COMPILING INSTRUCTIONS

  • To build the executables for both chatclient and chatserver run the following command from the terminal inside the project directory:

    $ make
    
  • To delete the executable files you can run:

    $ make clean
    

RUNNING INSTRUCTIONS

  • First run the chatserver executable with the following usage:
      $ ./chatserver [port_number]
    
    e.g.
      $ ./chatserver 5001
    

  • To run a client executable use:
      $ ./chatclient [port_number] [username] [password]
    
    e.g.
      $ ./chatclient 5001 andy secret-password
    

OUTPUTS

  • serveroutput.txt complete log of the chat from the server view with logins/logouts and messages received (shortcuts will be displayed as received by the client, therefore not yet transformed);

SPECIFICATIONS

  • C Standard: C99
  • Compiler: GCC
  • IP address: 127.0.0.1 (hardcoded)
  • Password: secret-password (hardcoded)
  • Max length of message inputtable by the client: 1024 characters
  • Edited with: CLion 2020.2.4
  • Written on: MacOS 11.2.1
  • Tested on:
    - MacOS 11.2.1
    - Ubuntu 18.04

LIBRARIES USED

  • arpa/inet
  • ctype (C Standard Library)
  • pthread
  • signal (C Standard Library)
  • stdio (C Standard Library)
  • stdlib (C Standard Library)
  • string (C Standard Library)
  • sys/socket
  • time (C Standard Library)
  • unistd

About

Client-Server chat room service realized as a socket programming and networking exercise

Topics

Resources

Stars

Watchers

Forks