Skip to main content

Awesome pysockmmsg created by pappacena

Project description

pysockmmsg

codecov CI

Python wrappers for Linux's sendmmsg and recvmmsg system calls.

When sending/receiving a large amount of packets, preparing the data to be send/received using only a single system call can improve a lot the overal performance by reducing kernel/userland context switching.

Install it from PyPI

pip install pysockmmsg

Usage

Sending multiple messages at a time

import socket
from pysockmmsg import sendmmsg

data_to_send = {
    ('10.10.1.20', '5555'): [b"msg1", b"msg2", b"msg3"],
    ('10.10.1.25', '5555'): [b"msg4", b"msg5"],
    ('10.10.1.26', '5555'): [b"msg6", b"msg7", b"msg8", b"msg9"],
}

sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sendmmsg(sock, data_to_send, total_packets=9)

Development

Read the CONTRIBUTING.md file.

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

pysockmmsg-0.0.2.tar.gz (15.4 kB view details)

Uploaded Source

File details

Details for the file pysockmmsg-0.0.2.tar.gz.

File metadata

  • Download URL: pysockmmsg-0.0.2.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.7.0 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.5

File hashes

Hashes for pysockmmsg-0.0.2.tar.gz
Algorithm Hash digest
SHA256 0b37101b4b993da30faf02032c0c483c9b89e0e9f835b432ab9952de0ce31458
MD5 218543c64e5b861ddacf276a1e94a38b
BLAKE2b-256 8bc64cd5039f68cb87306ca1862179d32796c74b8e3b8c24631e50b0b1d5ff64

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