Function
MakeStreamManagerWithSizes
(cwndSize, cirbufSize int)
Source from the content-addressed store, hash-verified
| 67 | } |
| 68 | |
| 69 | func MakeStreamManagerWithSizes(cwndSize, cirbufSize int) *StreamManager { |
| 70 | sm := &StreamManager{ |
| 71 | buf: MakeCirBuf(cirbufSize, true), |
| 72 | eofPos: -1, |
| 73 | cwndSize: cwndSize, |
| 74 | rwndSize: cwndSize, |
| 75 | } |
| 76 | sm.drainCond = sync.NewCond(&sm.lock) |
| 77 | go sm.senderLoop() |
| 78 | return sm |
| 79 | } |
| 80 | |
| 81 | // AttachReader starts reading from the given reader |
| 82 | func (sm *StreamManager) AttachReader(r io.Reader) error { |