Skip to main content

Crate netsock

Crate netsock 

Source
Expand description

Cross-platform socket inspection for TCP and UDP.

netsock provides iterators and collection APIs for enumerating sockets on Linux, macOS, Windows, and FreeBSD.

Modules§

error
family
process
protocol
socket
state

Structs§

ProcessCache
Snapshot of process-to-socket inode mappings on Linux.

Functions§

get_sockets
Collects sockets that match the requested address families and protocols. Collects sockets into a Vec using the provided filters.
iter_sockets
Returns an iterator over sockets that match the requested filters. Returns sockets with process ownership attached.
iter_sockets_with_cache
Returns sockets using a caller-provided process cache. Returns sockets with process ownership attached using a prebuilt cache.
iter_sockets_without_processes
Returns sockets without process ownership data.