Skip to main content

Extension providing a basic networking protcol implementations as a Python module using mainly C-Extenstions.

Project description

networkinglib

Python Networking Module

How to use

TCP Client

Opening socket and connecting to server

from networkinglib import tcp
socket = tcp.connect('127.0.0.1', 7777)
if not socket: print("Could not connect!")

Sending packet

socket.send("Hello Server!")

Receiving Packets

print(socket.receive())

Closing connection

socket.close()

UDP Client

Opening socket

from networkinglib import udp
socket = udp.open()
if not socket: print("An unexpected error occured!")

Sending packet

socket.send("Hello Server!", "127.0.0.1", 7777)
# or
socket.send("Hello Server!", "127.0.0.1:7777")

Receiving Packets

msg, source_address, source_port = socket.receive()
print('Received:\n', msg, 'From:\n', source_address + ':' + str(source_port))

Closing connection

socket.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

networkinglib-0.2.7.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

networkinglib-0.2.7-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file networkinglib-0.2.7.tar.gz.

File metadata

  • Download URL: networkinglib-0.2.7.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for networkinglib-0.2.7.tar.gz
Algorithm Hash digest
SHA256 20d0b654a7d5e6f6cecb4e4d0134859d3b326d1e5cb5fa0472b6f6d748eb832c
MD5 4e4004e74dd63c9a84a9e917f96aca4d
BLAKE2b-256 299ed4562ffe938ca94c98a90ff74f163223d3dc1d02e73cbc139bb150f1bbf5

See more details on using hashes here.

File details

Details for the file networkinglib-0.2.7-py3-none-any.whl.

File metadata

File hashes

Hashes for networkinglib-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 c03f6ab3ed2e6635a7c72d9909405615a3f30520c8487afef3f775565405faa4
MD5 44c669030e5d4199320ab0de2d1fb081
BLAKE2b-256 6fcfb9b2063c8419ab649238966f255841c5fb3539ede981c7b2d4b763c5ff7d

See more details on using hashes here.

Supported by

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