How smux architecture works
masterSmux (Simple MUltipleXing) is a stream-oriented multiplexing library for Golang that runs on top of a reliable, ordered connection like TCP or KCP. It uses three core abstractions:
- Session: The primary manager for a multiplexed connection. It manages the underlying
io.ReadWriteCloser, handles the creation and acceptance of streams, and manages the shared receive buffer. - Stream: A logical stream within a session. Each stream implements the
net.Conninterface, allowing you to handle data buffering and flow control for individual streams independently. - Frame: The wire format used for data transmission.