Reseau.jl
Reseau.jl is a pure-Julia networking transport stack with deadline-aware TCP, hostname-aware dialing, and TLS in one package. The public surface is deliberately small: plain TCP lives under Reseau.TCP, datagrams under Reseau.UDP, and TLS under Reseau.TLS. String-address dialing uses the same entrypoints, while the advanced resolver types behind that behavior are documented separately in Name Resolution. Filesystem Unix socket clients are available through Reseau.Unix.
Installation
using Pkg
Pkg.add("Reseau")Module Entry Points
The package exports TCP, UDP and TLS. Filesystem Unix socket clients use the qualified Reseau.Unix namespace:
Reseau.TCP — Module
TCPCore TCP socket operations and connection/listener types.
This layer sits directly above SocketOps and IOPoll. It is responsible for turning raw non-blocking sockets into higher-level connection/listener objects, including:
- sockets are created non-blocking and registered with the poller
- non-blocking connect completes by waiting for write readiness and then reading
SO_ERROR - accept returns already-initialized child descriptors that are ready for the same poll-driven read/write paths as outbound connections
- deadline expiry is surfaced as
TCP.DeadlineExceededErrorfor transport I/O
Reseau.Unix — Module
UnixFilesystem Unix-domain stream clients on Linux, macOS and FreeBSD.
Use Reseau.Unix.connect(path) to open a poll-driven IO connection. Reads, writes, half-close and deadlines follow the same stream contracts as TCP. The client owns its descriptor and never removes the server's socket path.
Reseau.UDP — Module
UDPCore UDP socket operations and the datagram connection type.
This layer sits directly above SocketOps, IOPoll, and NetCommon, and mirrors Go's net.UDPConn:
- one
Conntype serves both unconnected (bound) and connected sockets listenbinds a socket forsendto/recvfrom-style use;connectfixes a peer sosend/recvapply and ICMP errors surface asSystemErrors- a datagram is sent and received whole: there are no partial transfers, a zero-byte datagram is valid data rather than EOF, and
Connis deliberately not anIO(stream helpers likereadlinewould corrupt datagram boundaries) - deadline expiry is surfaced as
UDP.DeadlineExceededError, with the same sticky per-socket deadline model asTCP
Reseau.TLS — Module
TLSTLS client/server layer built on native TLS 1.2/1.3 machinery, OpenSSL-backed crypto/X.509 helpers, and TCP connections.
This layer provides:
- reusable
Configobjects for client and server policy Connwrappers that can handshake eagerly or lazily on first I/O- deadline handling delegated to the wrapped transport so TLS retries follow the same timeout model as plain TCP
- transport timeout handling is available as
TLS.DeadlineExceededError
Read API Reference for the canonical public docstrings and Name Resolution for the advanced resolver, policy, and "host:port" dialing layer.
Why Reseau
- Deadline and readiness behavior live inside the transport instead of in ad hoc timeout wrappers.
- Concrete-address and hostname-based dialing use the same
TCP.connectandTLS.connectentrypoints. - TLS keeps the same lifecycle and deadline model as TCP, including lazy handshakes and transport-backed I/O.
- Because
TCP.ConnandTLS.ConnareIOsubtypes, standard helpers likeread,read!,readbytes!,eof, andwritework directly on live connections.
Quick Start
This example stays entirely local: it opens a loopback listener, echoes one payload, and shows the reply that came back over the socket.
using Reseau
listener = TCP.listen(TCP.loopback_addr(0); backlog = 16)
server = @async begin
conn = TCP.accept(listener)
try
write(conn, "echo:" * String(read(conn)))
finally
close(conn)
close(listener)
end
end
client = TCP.connect(TCP.addr(listener))
reply = ""
try
write(client, "hello")
closewrite(client)
reply = String(read(client))
finally
close(client)
end
wait(server)
reply""Documentation Map
- Read TCP for plain connections, address constructors, deadlines, I/O semantics, and socket options.
- Read Unix Socket Clients for local filesystem connections.
- Read UDP for connected and unconnected datagram sockets.
- Read TLS for
TLS.Config, client/server wrappers, lazy handshakes, and connection-state inspection. - Read Name Resolution for advanced resolver controls behind the string-address entrypoints.
- Read Migrating from
Socketsto Reseau if you are porting code from Julia's stdlibSockets. - Read API Reference for canonical docstrings and a generated docstring index.