mirror of
https://github.com/xtaci/smux.git
synced 2024-04-21 10:51:48 +00:00
e401d2f60ea5a2487f667dab5c652b2b176bb704
smux simple multiplexing
goals
- receive window is shared among the streams.
- precise flow control(pluggable stragety like linux TC).
- precise memory control.
- maximized payload.
- optimized for high-speed streams.
- aim for game services.
FRAMETYPE=Data, OPTIONS=(flagSYN, flagACK, flagFIN, flagRST)
+---------------+--------------+------------+--------------+--------------------------------+
| | | | | |
| FRAMETYPE(1B) | OPTIONS(1B) | LENGTH(2B) | STREAMID(4B) | DATA(MAX 64K) |
| | | | | |
+---------------+--------------+------------+--------------+--------------------------------+
FRAMETYPE=WindowUpdate
+---------------+--------------+------------+
| | |
| FRAMETYPE(1B) | WINDOWSIZE(4B) |
| | |
+---------------+--------------+------------+
FRAMETYPE=Ping, OPTIONS=(flagSYN, flagACK)
+---------------+--------------+------------+------------+
| | | |
| FRAMETYPE(1B) | OPTIONS(1B) | PINGID(4B) |
| | | |
+---------------+--------------+------------+------------+
FRAMETYPE=GoAway
+---------------+---------------+
| | |
| FRAMETYPE(1B) | ERROR(2B) |
| | |
+---------------+---------------+
Stream.Write([]byte)
--> Framer.split([]byte)
--> Qdisc.Enqueue(Frame)
--> (goroutine: Session.xmit() { Qdisc.Dequeue() }
--> conn.Write(Framer.serialize())
Stream.Read([]byte)
--> Stream.RxQueue <-- Framer.deserialize <-- (goroutine: Session.recvLoop(conn))
status
in-progress
Languages
Go
100%