Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/prajwalpd7/echo-client-server
https://github.com/prajwalpd7/echo-client-server
Last synced: 4 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/prajwalpd7/echo-client-server
- Owner: prajwalpd7
- Created: 2022-12-30T09:00:33.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-30T09:03:02.000Z (almost 2 years ago)
- Last Synced: 2023-07-13T12:25:25.006Z (over 1 year ago)
- Language: Python
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Echo-Client-Server
# Echo Client/Server Program
This project contains a simple echo client/server program that demonstrates the use of the `socket` module in Python. The client sends a message to the server, and the server sends the message back to the client.
## Prerequisites
To run this project, you will need to have Python installed on your computer.
## Running the Server
To start the server, use the following command:
python echoserver.py
The server will listen for incoming connections on a specified port (the default is 8000).
## Running the Client
To start the client, use the following command:
python echoclient.py
The client will prompt you to enter a message to send to the server. The server will receive the message and send it back to the client, which will then print the received message.
## Customizing the Server and Client
You can customize the behavior of the server and client by modifying the `handle_client` function in the server script and the `send_message` function in the client script. For example, you could add additional functionality to the message handling process, such as logging the messages or implementing additional commands.
## Additional Notes
The `socket` module is a powerful tool for building networked applications in Python. This simple echo client/server program is just a demonstration of the capabilities of the `socket` module, and there are many other ways that it can be used in a variety of applications.