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.
| Question | Pavia | Socket.IO |
|---|---|---|
| TRANSPORT | ||
| Bindings | YesWebTransport over HTTP/3, raced against WebSocket | PartlyLong polling upgraded to WebSocket; WebTransport opt-in |
| Plain-HTTP fallback | NoNone by design: WebSocket is the fallback | YesLong polling |
| Wire format | YesBinary CBOR frames; cbor or json payloads | PartlyJSON-like packets with binary attachments; MessagePack parser |
| CALLS | ||
| Request and response | YesCalls with a result or a structured error | PartlyAcks, with a timeout |
| Streaming | YesServer, client and bidirectional, with flow control | NoNo streaming API |
| Cancellation | YesThe caller cancels; deadlines on every call | NoNone |
| Ordering | PartlyWithin a stream and a lane; none across streams | YesGuaranteed on every transport |
| CONTRACTS | ||
| Schema | YesMachine-readable manifest with a fingerprint | PartlyTypeScript event interfaces |
| Client generation | YesGenerated from the manifest; compatibility checker | NoTypes written by hand on each side |
| MESSAGING | ||
| Targets | YesSessions, users, groups, all, except | PartlyRooms and namespaces; users by convention |
| Delivery | YesExactly-once and ordered per lane within a session, with resumption | PartlyAt-most-once by default; client retries opt-in |
| Channel history | YesGapless recovery by epoch and offset | NoNone; persist events in your own database |
| Presence | YesSnapshot, joins, leaves, updates | NoList sockets yourself |
| Lossy datagrams | YesReal on WebTransport, latest-value topics | PartlyVolatile events, still on a reliable stream |
| OPERATIONS | ||
| Scale-out | YesNATS with JetStream | YesRedis, MongoDB, Postgres, cloud queue adapters |
| Server | PartlyRust, with an axum adapter | YesNode, plus Java, Python, Go and Rust ports |
| Clients | PartlyTypeScript and Rust; open spec for others | YesAbout 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.
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
- Socket.IO introduction: server and client implementations
- How Socket.IO works: transports and upgrades
- Socket.IO with WebTransport
- The Socket.IO protocol
- Custom parsers, including MessagePack
- Emitting events and acknowledgements
- Client API: emitWithAck
- Delivery guarantees
- Connection state recovery
- Rooms
- Namespaces
- Server instance: fetchSockets
- Adapters
- TypeScript usage
- socketioxide
- Pavia specification, sections 7.8, 8.9, 11 and 13