TCP
Use Riot’s TCP surface when the problem is connection-oriented and you need more control than a high-level HTTP abstraction provides.
Typical use cases
Section titled “Typical use cases”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
Why users land here
Section titled “Why users land here”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.
The practical split
Section titled “The practical split”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.