This is a basic example showcasing communication via sockets in Python. The code consists of a client and a server communicating with each other using TCP/IP sockets.
- Python 3.10
- Run the
server.py
file. - The server will be waiting for incoming connections.
- Once a connection is established with a client, the server will await messages from the client and respond to them.
- Run the
client.py
file. - The client will connect to the server.
- Enter messages, which will be sent to the server.
- The client will receive and display responses from the server.
- Exception handling to detect and manage potential errors during connection and communication.
- Code structured into separate functions for readability and organization.
- Console status messages indicating established connections and their closure.
- The client and server are configured to communicate on
localhost
(127.0.0.1) and port12345
. You can modify these variables to suit your needs. - The client can terminate the connection by entering "adiós".
Feel free to contribute to the project by providing enhancements, bug fixes, or suggestions. If you wish to add new features, fork the project and submit a pull request.
Created by [jhonZambrano1999] - [https://github.com/jhonZambrano1999/Ejemplo_-sockets_python/edit/main/README.md].