Python TCP and UDP sockets made easy.
Project description
pyeasysocket
Python TCP and UDP sockets made easy.
install
pip install pyeasysocket
quick start
Create a TCPReceiver:
from pyeasysocket.udp import UDPReceiver
from pyeasysocket.tcp import TCPReceiver
receiver_udp = UDPReceiver('localhost', 8001)
receiver = TCPReceiver('localhost', 8000)
try:
# run background thread for receive
receiver.start()
# wait for data
received_data = receiver.data
finally:
receiver.join() # closes the background thread
Or use the advantage of a with statement with the guarantee that the connection will be closed.
import time
from pyeasysocket.tcp import TCPReceiver, TCPClient
client = TCPClient('localhost', 8000)
with TCPReceiver('localhost', 8000) as receiver:
client.send('test')
time.sleep(0.2) # only for timing purpose
received_data = receiver.data # test
issue tracker
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyeasysocket-1.0.0-py3-none-any.whl.
File metadata
- Download URL: pyeasysocket-1.0.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.6.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b868bb1112b9c6cc944165e139c0053f94a0ff8c3b40c7d8878bfd4c6cf4a2d9
|
|
| MD5 |
c1c8360a927ae2380549cd90fc8f2639
|
|
| BLAKE2b-256 |
172fd64ebc1dc98bada82d6eb3a63cff91b5da3b5962d3b237ae02e9c854fde9
|