Skip to main content

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.

Release files for pysockmmsg 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pysockmmsg 0.0.2
File Size Uploaded
pysockmmsg-0.0.2.tar.gz 15.4 kB Details

Release files / pysockmmsg-0.0.2.tar.gz

Download URL pysockmmsg-0.0.2.tar.gz
Size 15.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0b37101b4b993da30faf02032c0c483c9b89e0e9f835b432ab9952de0ce31458
BLAKE2b-256 checksum
How to use checksums
8bc64cd5039f68cb87306ca1862179d32796c74b8e3b8c24631e50b0b1d5ff64
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page