// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
// SPDX-License-Identifier: MIT

package allocation

import (
	
	

	
	
)

// ChannelBind represents a TURN Channel
// See: https://tools.ietf.org/html/rfc5766#section-2.5
type ChannelBind struct {
	Peer   net.Addr
	Number proto.ChannelNumber

	allocation    *Allocation
	lifetimeTimer *time.Timer
	log           logging.LeveledLogger
}

// NewChannelBind creates a new ChannelBind.
func ( proto.ChannelNumber,  net.Addr,  logging.LeveledLogger) *ChannelBind {
	return &ChannelBind{
		Number: ,
		Peer:   ,
		log:    ,
	}
}

func ( *ChannelBind) ( time.Duration) {
	.lifetimeTimer = time.AfterFunc(, func() {
		if !.allocation.RemoveChannelBind(.Number) {
			.log.Errorf("Failed to remove ChannelBind for %v %x %v", .Number, .Peer, .allocation.fiveTuple)
		}
	})
}

func ( *ChannelBind) ( time.Duration) {
	if !.lifetimeTimer.Reset() {
		.log.Errorf("Failed to reset ChannelBind timer for %v %x %v", .Number, .Peer, .allocation.fiveTuple)
	}
}