This commit is contained in:
xtaci
2016-08-28 17:22:25 +08:00
parent 7a5bd73be5
commit e401d2f60e
2 changed files with 13 additions and 3 deletions
+9 -3
View File
@@ -1,4 +1,4 @@
# smux
smux
simple multiplexing
# goals
@@ -38,8 +38,14 @@ FRAMETYPE=GoAway
| | |
+---------------+---------------+
Stream.Write([]byte) --> Framer --> Qdisc.Enqueue() --> (goroutine: Session.xmit() { Qdisc.Dequeue() } --> conn.Write([]byte)
Stream.Read([]byte) --> Stream.RxQueue <-- (goroutine: Session.recvLoop(conn))
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
+4
View File
@@ -15,6 +15,10 @@ type Frame struct {
type Framer struct {
}
// split bytestream into frames
func (fr *Framer) split(bts []byte) []*Frame {
}
// serialize a frame to transmit
func (fr *Framer) serialize(f *Frame) []byte {
return nil