The decentralized auto-discovery lan chat client.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Brandon Hartshorn ff261bb68b
Add message receipt info to readme
4 years ago
.gitignore Initial commit 4 years ago
LICENSE Initial commit 4 years ago
README.md Add message receipt info to readme 4 years ago
lanchat.py Clean up lanchat.py, expound readme for submission 4 years ago

README.md

LanChat

Description

LanChat is a simple decentralized chat client. It does not require a server for discovery of other chat users. Instead, each client periodically sends out a broadcast packet announcing it's presence on the network. Each client keeps a list of other clients.

Note this can only function on a single subnet, and only if UDP broadcast packets can travel freely between individual clients on the network.

Usage

LanChat requires only Python 3, and uses only system libraries. Tested on Python 3.7.2.

Start the client using: ./lanchat.py <username>

A simple command line interface is shown. Other known clients will be displayed with an index under the "Send to:" header on the terminal output. Upon first startup, the client most likely won't know about other clients, because it learns about them only as it receives broadcast packets from them. Submitting r as input to the prompt will refresh the interface so you can check for other users.

Once another user is found and displayed, simple enter the number associated with that user, and the program will prompt for the message to send to that user. Type the message to be sent, and hit enter. The message will be sent asynchronously by a separate thread after polling for received messages, so the message may take a moment to arrive to the other client.

Messages from other clients are received asynchronously, but not displayed asynchronously to avoid mangling the prompt upon receipt. In order to show new messages, submit r at the prompt. Messages will be displayed above the prompt options.