serp-socket
TCP and UDP sockets for Serpentine. Runtime-backed ([R]): native builds use
std::net in the Serpentine runtime; under CPython the same imports delegate
to the stdlib socket module. Handles are opaque ints.
from serp_socket import connect, send, recv, close
h: int = connect("127.0.0.1", 8080, 3000) # 3s connect timeout
send(h, b"ping")
print(recv(h, 4096))
close(h)
API
TCP:
connect(host, port, timeout_ms) -> int—timeout_ms > 0bounds the connectlisten(host, port) -> int(port 0 = pick a free port),accept(listener) -> intsend(h, data: bytes) -> int(sends everything),recv(h, maxlen) -> bytes(empty = peer closed)shutdown_write(h)— half-close so the peer sees EOF
UDP:
udp_bind(host, port) -> int,udp_send_to(h, data, host, port) -> intudp_recv_from(h, maxlen) -> bytes+udp_peer_host(h)/udp_peer_port(h)for the sender
Both:
set_timeout(h, ms)(0 = blocking),local_port(h) -> int,close(h)
Errors
Normalized identically in both worlds: OSError with one of
"connection refused", "timed out", "connection reset",
"address in use", "not connected", "address resolution failed",
"socket error"; misuse raises ValueError. IPv4 and IPv6 addresses both
work; hostname resolution takes the first result, so prefer explicit IPs
(127.0.0.1) when the family matters.
Metadata
Release files for serp-socket 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| serp_socket-0.1.0.tar.gz | 4.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| serp_socket-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.1 kB
Release files / serp_socket-0.1.0.tar.gz
| Download URL | serp_socket-0.1.0.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
52c416d3ae239d03dc3386dd43e7edcfbcd7a3d5a8802f0fb4dd8285826eca06
|
|
BLAKE2b-256 checksum How to use checksums |
a19026c818755105c8dcb392b8d6d058ad595de78c45413a060067d27c44415c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.
Transparency logRelease files / serp_socket-0.1.0-py3-none-any.whl
| Download URL | serp_socket-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5d2ffa9b6d7b366bd8503678110122314786e436ac9d67a2f48921e58be5cc59
|
|
BLAKE2b-256 checksum How to use checksums |
6a51b9da6ededb27ad317db2cba330b0b46d44f88df3a97f93b76f0da1f22085
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.
Transparency log