Skip to content
Riot Docs

Search is only available in production builds. Try building and previewing the site to test it out locally.

Install Riot GitHub

TCP

Use Riot’s TCP surface when the problem is connection-oriented and you need more control than a high-level HTTP abstraction provides.

TCP becomes the right layer when you need to:

  • open client connections directly
  • accept inbound connections with a listener
  • manage stream-oriented protocols
  • build custom servers that are not only HTTP

Most users do not start by wanting “TCP”. They start by wanting:

  • a lower-level server
  • a custom protocol
  • direct control over transport behavior

This page exists to make that descent obvious instead of accidental.

Use the server-level APIs when:

  • the problem is HTTP-shaped
  • the framework already fits the use case

Drop to TCP when:

  • you need stream control
  • the protocol is custom
  • you are working below the request/response level

That is the decision this page should help with.