—- sockData - send other data types via socket —-
This library can send other data types than just strings with socket. You can normally only send strings with socket. But with this library, you can send all data types that are supported by pickle.
- How to use it:
- Sending:
instead of ‘<yourConnectedSocket>.send(<string>.encode())’ type: ‘import sockData.send sockData.send.sendData(<yourConnectedSocket>, <data>)’
- Receiving:
instead of ‘<yourConnectedSocket>.recv(<bufferSize>)’ type: ‘import sockData.receive sockData.receive.recvData(<yourConnectedSocket>, <bufferSize>)’
Examples:
server.py:
import socket import sockData.receive
sock = socket.socket() sock.bind((“”, 50505)) sock.listen(1)
client, addr = sock.accept()
dictionary = sockData.receive.recvData(client, 1024) print(dictionary)
client.close()
client.py:
import socket import sockData.send
sock = socket.socket() sock.connect((“127.0.0.1”, 50505))
dictionary = {“message”: {“from”: “127.0.0.1”, “msg”: “hello!”}} sockData.send.sendData(sock, dictionary)
sock.close()
Release files for sockData 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sockData-1.0.1.tar.gz | 1.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sockData-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 4.5 kB
Release files / sockData-1.0.1.tar.gz
| Download URL | sockData-1.0.1.tar.gz |
|---|---|
| Size | 1.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b4dd5aefdb9111498f6c18fa37517059ad51a7a85ed2b8329da807cfc0aefa59
|
|
BLAKE2b-256 checksum How to use checksums |
789eb4fd2b6219d4942d80e87069032eba1c58a71b0a89417ec572c243161bb1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / sockData-1.0.1-py3-none-any.whl
| Download URL | sockData-1.0.1-py3-none-any.whl |
|---|---|
| Size | 2.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fcc17e702c53d02583b2575f067d17d8af56af38b1031b9df0e5fb14705c93e1
|
|
BLAKE2b-256 checksum How to use checksums |
5691e2cf0fd658e857434bab86c5bc16be3df42b8063635cdd6d3042d30bd9d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |