Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Atsushi Watanabe <[email protected]>
backkem <[email protected]>
cnderrauber <[email protected]>
David Colburn <[email protected]>
David Zhao <[email protected]>
Herman Banken <[email protected]>
Hugo Arregui <[email protected]>
Igor German <[email protected]>
Expand Down
5 changes: 5 additions & 0 deletions internal/allocation/allocation.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ import (
"github.com/pion/turn/v2/internal/proto"
)

const (
allocationDeadline = 30 * time.Second
)

type allocationResponse struct {
transactionID [stun.TransactionIDSize]byte
responseAttrs []stun.Setter
Expand Down Expand Up @@ -245,6 +249,7 @@ func (a *Allocation) packetHandler(m *Manager) {
buffer := make([]byte, rtpMTU)

for {
_ = a.RelaySocket.SetReadDeadline(time.Now().Add(allocationDeadline))
n, srcAddr, err := a.RelaySocket.ReadFrom(buffer)
if err != nil {
m.DeleteAllocation(a.fiveTuple)
Expand Down