Skip to main content

Socket extension

Project description

—- 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()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sockData-1.0.1.tar.gz (1.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sockData-1.0.1-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file sockData-1.0.1.tar.gz.

File metadata

  • Download URL: sockData-1.0.1.tar.gz
  • Upload date:
  • Size: 1.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for sockData-1.0.1.tar.gz
Algorithm Hash digest
SHA256 b4dd5aefdb9111498f6c18fa37517059ad51a7a85ed2b8329da807cfc0aefa59
MD5 7396806a2a346eb85d73402293667629
BLAKE2b-256 789eb4fd2b6219d4942d80e87069032eba1c58a71b0a89417ec572c243161bb1

See more details on using hashes here.

File details

Details for the file sockData-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for sockData-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fcc17e702c53d02583b2575f067d17d8af56af38b1031b9df0e5fb14705c93e1
MD5 a52defa106e341266b75fc46f41ebeb5
BLAKE2b-256 5691e2cf0fd658e857434bab86c5bc16be3df42b8063635cdd6d3042d30bd9d5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page