Skip to content

System Level Programming Final Project: Terminal Chat program LAN written in C

Notifications You must be signed in to change notification settings

WilliamC07/ChatProgram

Repository files navigation

Sloth Chat

The team:

William Cao Period 10

Broad descriptor of project

A chat program in which up to 20 people can connect to one computer (host) and talk to one another. The host saves the chat log for continutation in the future.

Required libraries

None!

How to use

To install the program:

  1. Clone this repository using https:
    $ git clone https://github.com/WilliamC07/c-chatter.git
  2. Run make:
    $ make

Run the program

  1. The host computer should run one of the following: To open an existing chat, run:
    $ ./output -o <name of chat> 
    # To see chat that you have run
    $ ls ~/.slothchat
    To create a new chat, run:
    $ ./output -c <name of chat> <your username>
    Note: Your username cannot be more than 25 characters long. The program will cut off additional characters. Username cannot be "system" or "System"
  2. Everyone who wants to run the program should run:
    $ ./output -j <host IPv4 address> <client username>
    Note: there can be a maximum of 20 active people connected including the host. Note: Your username cannot be more than 25 characters long. The program will cut off additional characters. Username cannot be "system" or "System"

Instructions when running

  • You can start typing right away and send messages! Just press enter at the end of your message. You are capped at 255 characters. The program will ignore all input past 255 characters.
  • Your message cannot start with a white space nor be blank (no characters/only white space).
  • Use the up and down arrow keys to scroll the chat. Don't have up and down arrow key? Get a real keyboard.
  • How do i read the display? Here: How to read
  • Press Control-C to exit the program. If you are host, the chat will automatically be saved. If you are a client connecting, you will not get a copy, there is no option to do so.

Need a reminder on the terminal? Run:

$ ./output -h

To uninstall

  1. Delete the repository
  2. Delete "~/.slothchat"
    $ rm -rf ~/.slothchat

Bugs

  • This isn't really a bug, there there are some extended waiting periods (hardcoded wait() periods) for the socket to be ready or packet to be sent out before shutting down the server.
  • Also not really a bug, I didn't implement the feature to notify everyone when someone joins the chat. Only notifies if someone leaves the chat. It is a feature for the FBI to spy on chat more easily.

Works Cited

Dev log

link

Comments

  • I hope there aren't any race conditions :)
  • The program uses port 7777

About

System Level Programming Final Project: Terminal Chat program LAN written in C

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published