https://github.com/hazzery/socket-programming
Sever-Client program pair capable of delivering messages between clients.
https://github.com/hazzery/socket-programming
python python3 socket-programming tcp-client tcp-server
Last synced: 5 months ago
JSON representation
Sever-Client program pair capable of delivering messages between clients.
- Host: GitHub
- URL: https://github.com/hazzery/socket-programming
- Owner: hazzery
- License: agpl-3.0
- Created: 2023-08-31T21:36:37.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2026-01-12T20:42:23.000Z (6 months ago)
- Last Synced: 2026-01-13T01:29:09.985Z (6 months ago)
- Topics: python, python3, socket-programming, tcp-client, tcp-server
- Language: Python
- Homepage:
- Size: 305 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: COPYING.md
Awesome Lists containing this project
README
# Socket Programming

[](https://codecov.io/gh/hazzery/socket-programming)
[](https://results.pre-commit.ci/latest/github/hazzery/socket-programming/master)
[](https://github.com/astral-sh/ruff)
[](https://mypy-lang.org/)
## Note
This project is under current development, check the [`dev` branch](https://github.com/hazzery/socket-programming/tree/dev)
to see the latest contributions.
## Usage Instructions
To start the server program, execute the following command in the project directory.
```bash
python3 -m server
```
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.
```bash
python3 -m client
```
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
```bash
python3 -m server 12000
```
### Client 1
```bash
python3 -m client localhost 12000 Alice create
John
Hello John! How are you?
```
### Client 2
```bash
python3 -m client localhost 12000 John read
```
## Licence
This project is licenced under the GNU AGPL version 3
