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 and TLS lives under Reseau.TLS. String-address dialing uses the same entrypoints, while the advanced resolver types behind that behavior are documented separately in Name Resolution.

Installation

using Pkg
Pkg.add("Reseau")

Module Entry Points

The package exports only TCP and TLS, which keeps the public API module-scoped instead of namespace-flat:

Reseau.TCPModule
TCP

Core 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.DeadlineExceededError for transport I/O
source
Reseau.TLSModule
TLS

TLS client/server layer built on OpenSSL and TCP connections.

This layer provides:

  • reusable Config objects for client and server policy
  • Conn wrappers 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
source

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.connect and TLS.connect entrypoints.
  • TLS keeps the same lifecycle and deadline model as TCP, including lazy handshakes and transport-backed I/O.
  • Because TCP.Conn and TLS.Conn are IO subtypes, standard helpers like read, read!, readbytes!, eof, and write work 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 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 Sockets to Reseau if you are porting code from Julia's stdlib Sockets.
  • Read API Reference for canonical docstrings and a generated docstring index.