Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/suyashsingh/python-sockets
Python Socket Programming
https://github.com/suyashsingh/python-sockets
python3 socket socket-client socket-programming socket-server
Last synced: 2 months ago
JSON representation
Python Socket Programming
- Host: GitHub
- URL: https://github.com/suyashsingh/python-sockets
- Owner: suyashsingh
- Created: 2020-05-18T10:08:34.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-05-18T16:49:55.000Z (over 4 years ago)
- Last Synced: 2023-10-29T17:24:44.931Z (about 1 year ago)
- Topics: python3, socket, socket-client, socket-programming, socket-server
- Language: Python
- Size: 4.88 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# python-sockets
Python Socket Programming> Note: run all the programs in *Python3*. Some of them might run on *Python2* as
well but don't get swayed away.
1. **simple-client-server**
+ Hello world client server application.
+ `client.py` requests for 1024 bytes from the server and displays it on
console and exit.
+ The server has a queue of 5 clients.
+ When it gets client connection it prints the client details on the console,
sends message and closes the client socket connection and keeps listening
for other clients.
+ Open two terminals and run: `python3 client.py` and `python3 server.py`2. **improved-client-server**
+ The server program is same as that of **simple-client-server** changes are
in the client.
+ The client earlier requested *1024 bytes* of data from the server now
instead it requests only *8 bytes* of data on one go. It keeps listening and
stiches together the data and displays it on the console.
+ The essential condition is for the server to break connection with the
client so that the client knows it should not wait for more data.
+ When server breaks connection client recievs *0 bytes* of data as an
indication of no more data.
+ Running the program is same as **simple-client-server**