Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/willmcgugan/asyncchat
Short example of how to implement Python's async from scratchw
https://github.com/willmcgugan/asyncchat
async await python
Last synced: 28 days ago
JSON representation
Short example of how to implement Python's async from scratchw
- Host: GitHub
- URL: https://github.com/willmcgugan/asyncchat
- Owner: willmcgugan
- License: mit
- Created: 2017-09-09T18:47:13.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-10-12T07:31:21.000Z (about 7 years ago)
- Last Synced: 2024-10-14T11:30:55.989Z (about 1 month ago)
- Topics: async, await, python
- Language: Python
- Homepage: https://www.willmcgugan.com/blog/tech/post/lifting-the-curtain-on-asyncio-magic/
- Size: 5.86 KB
- Stars: 29
- Watchers: 3
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# asyncchat
Asynchronous Telnet Chat ServerThis is an example of using Python's `async` and `await` keywords *without* the use of asyncio or other framework. Requires Python3.6.
Run the server with the following:
```
python3.6 asynchat.py
```Then connect with telnet as follows:
```
telnet 127.0.0.1 2323
```If you open multiple connections you will be able to send chat messages between clients.
If you want to run the server on the internet, launch `asyncchat.py` as follows:
```
sudo python3.6 asynchat.py 0.0.0.0 23
```Then you can connect with
```python
telnet
```