forked from quic-go/quic-go
add a method to the sendQueue to send probe packets (#4939)
This commit is contained in:
@@ -1,9 +1,14 @@
|
||||
package quic
|
||||
|
||||
import "github.com/quic-go/quic-go/internal/protocol"
|
||||
import (
|
||||
"net"
|
||||
|
||||
"github.com/quic-go/quic-go/internal/protocol"
|
||||
)
|
||||
|
||||
type sender interface {
|
||||
Send(p *packetBuffer, gsoSize uint16, ecn protocol.ECN)
|
||||
SendProbe(*packetBuffer, net.Addr)
|
||||
Run() error
|
||||
WouldBlock() bool
|
||||
Available() <-chan struct{}
|
||||
@@ -57,6 +62,10 @@ func (h *sendQueue) Send(p *packetBuffer, gsoSize uint16, ecn protocol.ECN) {
|
||||
}
|
||||
}
|
||||
|
||||
func (h *sendQueue) SendProbe(p *packetBuffer, addr net.Addr) {
|
||||
h.conn.WriteTo(p.Data, addr)
|
||||
}
|
||||
|
||||
func (h *sendQueue) WouldBlock() bool {
|
||||
return len(h.queue) == sendQueueCapacity
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user