Pavia vs Socket.IO

Both keep one connection open and let either side send at any time. Socket.IO works in events and acknowledgements, with a Node server and ports such as socketioxide for Rust. Pavia is a typed protocol: four call shapes with cancellation, channels with history, and real datagrams over WebTransport.

Socket.IO facts checked against socket.io and the socketioxide repository, November 2026.

Pick Socket.IO when

  • you want clients in about ten languages
  • clients need long polling behind strict proxies
  • your messages are events more than calls
  • you already run its Redis, MongoDB or Postgres adapters

Pick Pavia when

  • you want calls with results, streams and cancellation
  • clients are generated from a contract
  • channels need history and presence built in
  • cursors or telemetry should travel as lossy datagrams

SIDE BY SIDE

Feature by feature.

Pavia and Socket.IO, feature by feature
QuestionPaviaSocket.IO
TRANSPORT
BindingsYesWebTransport over HTTP/3, raced against WebSocketPartlyLong polling upgraded to WebSocket; WebTransport opt-in
Plain-HTTP fallbackNoNone by design: WebSocket is the fallbackYesLong polling
Wire formatYesBinary CBOR frames; cbor or json payloadsPartlyJSON-like packets with binary attachments; MessagePack parser
CALLS
Request and responseYesCalls with a result or a structured errorPartlyAcks, with a timeout
StreamingYesServer, client and bidirectional, with flow controlNoNo streaming API
CancellationYesThe caller cancels; deadlines on every callNoNone
OrderingPartlyWithin a stream and a lane; none across streamsYesGuaranteed on every transport
CONTRACTS
SchemaYesMachine-readable manifest with a fingerprintPartlyTypeScript event interfaces
Client generationYesGenerated from the manifest; compatibility checkerNoTypes written by hand on each side
MESSAGING
TargetsYesSessions, users, groups, all, exceptPartlyRooms and namespaces; users by convention
DeliveryYesExactly-once and ordered per lane within a session, with resumptionPartlyAt-most-once by default; client retries opt-in
Channel historyYesGapless recovery by epoch and offsetNoNone; persist events in your own database
PresenceYesSnapshot, joins, leaves, updatesNoList sockets yourself
Lossy datagramsYesReal on WebTransport, latest-value topicsPartlyVolatile events, still on a reliable stream
OPERATIONS
Scale-outYesNATS with JetStreamYesRedis, MongoDB, Postgres, cloud queue adapters
ServerPartlyRust, with an axum adapterYesNode, plus Java, Python, Go and Rust ports
ClientsPartlyTypeScript and Rust; open spec for othersYesAbout ten languages

The Pavia column describes the protocol as its specification defines it, and the reference implementation as it is designed. The conformance matrix shows which levels each implementation passes.

EVENTS AND CALLS

An event with an ack, or a call with a type.

Socket.IO names an event and waits for the ack. Pavia calls a method the client implements, and a wrong argument type fails at compile time, not in production.

Socket.IO · TypeScript
// Acknowledgement with a timeout.
const ok = await socket.timeout(10_000)
  .emitWithAck("confirm", "Leave room?");
Pavia · Rustillustrative
// The client implements this trait.
#[pavia::client_service]
trait Ui { async fn confirm(prompt: String) -> bool; }

let ok = ctx.session(id).ui()
    .deadline(Duration::from_secs(10))
    .confirm("Leave room?").await?;

RECONNECTS

What is still there after a dropped connection.

A phone switches from Wi-Fi to cellular. Here is what each side keeps when it comes back.

Socket.IO with connection state recovery

  • KeptSocket id, rooms, data and missed packets, within maxDisconnectionDuration
  • SomeOnly with the in-memory, Redis Streams or MongoDB adapters
  • LostNot always successful: check socket.recovered and resync
  • SomeOpt-in on the server

Pavia with session resumption

  • KeptNotifications and channel frames, replayed in order, 1 MiB buffer by default
  • KeptGroups, subscriptions and the authenticated user, for 30 s by default
  • KeptLonger outages: channels recover from history by epoch and offset
  • LostCalls in flight end with UNAVAILABLE; idempotent ones can retry

COMING FROM SOCKET.IO

Events become methods.

socketioxide runs on tower frameworks such as axum, and so does the Pavia server.

socket.emit(event)
Notification fire and forget
emitWithAck
Unary call with a typed result
socket.on(event)
Method handler from the contract
Namespace
Service a named set of methods
Room
Group or channel server-side, or client-subscribed
volatile.emit
Datagram on a latest-value topic
Connection state recovery
Resumption plus channel recovery
Redis adapter
NATS with JetStream for several nodes
socketioxide on axum
Pavia axum adapter same router

Questions

Can Socket.IO clients talk to a Pavia server?

No. Pavia has its own wire protocol, and compatibility with other frameworks is outside its goals. Moving over means generating a Pavia client from the contract.

Does Pavia keep messages in order like Socket.IO?

Within a stream and within a notification lane, yes. Across streams there is no order, because WebTransport delivers streams independently; that is what keeps one slow call from holding up the others. To notify after a result, await the result first.

What replaces volatile events?

Datagrams. On WebTransport they are real unreliable datagrams; topics marked latest deliver only newer values. On WebSocket they are emulated and coalesced.

Does Pavia support long polling?

No. The client races WebTransport and WebSocket and keeps the first that connects. If your users need long polling, Socket.IO covers that.

I run socketioxide. What changes?

socketioxide and the reference server both mount on axum. Events become methods in a contract, acks become call results, and rooms become groups, or channels when clients choose what to subscribe to.

Sources

More comparisons

Follow Pavia as it grows.

Subscribe to the Pavia newsletter.

One email per milestone. Unsubscribe from any email.

Star wolfware-labs/pavia