mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-04 04:37:36 +03:00
create internal interfaces for send and receive streams
And use those for handling frames.
This commit is contained in:
parent
7a3209b3a4
commit
e802491a8f
13 changed files with 391 additions and 58 deletions
12
stream.go
12
stream.go
|
@ -50,17 +50,20 @@ var _ streamSender = &uniStreamSender{}
|
|||
|
||||
type streamI interface {
|
||||
Stream
|
||||
|
||||
closeForShutdown(error)
|
||||
// for receiving
|
||||
handleStreamFrame(*wire.StreamFrame) error
|
||||
handleRstStreamFrame(*wire.RstStreamFrame) error
|
||||
getWindowUpdate() protocol.ByteCount
|
||||
// for sending
|
||||
handleStopSendingFrame(*wire.StopSendingFrame)
|
||||
popStreamFrame(maxBytes protocol.ByteCount) (*wire.StreamFrame, bool)
|
||||
closeForShutdown(error)
|
||||
// methods needed for flow control
|
||||
getWindowUpdate() protocol.ByteCount
|
||||
handleMaxStreamDataFrame(*wire.MaxStreamDataFrame)
|
||||
}
|
||||
|
||||
var _ receiveStreamI = (streamI)(nil)
|
||||
var _ sendStreamI = (streamI)(nil)
|
||||
|
||||
// A Stream assembles the data from StreamFrames and provides a super-convenient Read-Interface
|
||||
//
|
||||
// Read() and Write() may be called concurrently, but multiple calls to Read() or Write() individually must be synchronized manually.
|
||||
|
@ -77,7 +80,6 @@ type stream struct {
|
|||
}
|
||||
|
||||
var _ Stream = &stream{}
|
||||
var _ streamI = &stream{}
|
||||
|
||||
type deadlineError struct{}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue