mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-03 04:07:35 +03:00
introduce an interface for the send queue, use a mock in session tests
This commit is contained in:
parent
e9848fadf9
commit
f1c6421845
6 changed files with 117 additions and 22 deletions
|
@ -1,5 +1,11 @@
|
|||
package quic
|
||||
|
||||
type sender interface {
|
||||
Send(p *packetBuffer)
|
||||
Run() error
|
||||
Close()
|
||||
}
|
||||
|
||||
type sendQueue struct {
|
||||
queue chan *packetBuffer
|
||||
closeCalled chan struct{} // runStopped when Close() is called
|
||||
|
@ -7,7 +13,9 @@ type sendQueue struct {
|
|||
conn sendConn
|
||||
}
|
||||
|
||||
func newSendQueue(conn sendConn) *sendQueue {
|
||||
var _ sender = &sendQueue{}
|
||||
|
||||
func newSendQueue(conn sendConn) sender {
|
||||
s := &sendQueue{
|
||||
conn: conn,
|
||||
runStopped: make(chan struct{}),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue