Skip to content

Latest commit

 

History

History
68 lines (47 loc) · 2.27 KB

README.md

File metadata and controls

68 lines (47 loc) · 2.27 KB

Socket Programming

unittests passing codecov pre-commit.ci status Ruff Checked with mypy

Note

This project is under current development, check the dev branch to see the latest contributions.

Usage Instructions

To start the server program, execute the following command in the project directory.

python3 -m server <port_number>

This starts up a welcoming socket, which listens for client connections on the specified port_number for incoming connections.

To send and read messages, you must execute the client program using the following command.

python3 -m client <server_address> <port_number> <username> <message_type>

Here, server_address is the IP address of the computer in which the server program is running on, port_number is the port number on which the server program is listening for incoming connections, username is the name of the client connecting to the server, and message_type is the type of request to send to the server. This can be either create to send somebody a message, or read to receive messages that have been sent to you.

Upon making a Create request, you will be prompted to enter the name of the recipient of your message, and the message you would like to send them.

Example Usage

Server

python3 -m server 12000

Client 1

python3 -m client localhost 12000 Alice create
John
Hello John! How are you?

Client 2

python3 -m client localhost 12000 John read

Licence

This project is licenced under the GNU AGPL version 3

AGPLv3