Source File
rsrvtoken.go
Belonging Package
github.com/pion/turn/v4/internal/proto
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>// SPDX-License-Identifier: MITpackage protoimport// ReservationToken represents RESERVATION-TOKEN attribute.//// The RESERVATION-TOKEN attribute contains a token that uniquely// identifies a relayed transport address being held in reserve by the// server. The server includes this attribute in a success response to// tell the client about the token, and the client includes this// attribute in a subsequent Allocate request to request the server use// that relayed transport address for the allocation.//// RFC 5766 Section 14.9.type ReservationToken []byteconst reservationTokenSize = 8 // 8 bytes// AddTo adds RESERVATION-TOKEN to message.func ( ReservationToken) ( *stun.Message) error {if := stun.CheckSize(stun.AttrReservationToken, len(), reservationTokenSize); != nil {return}.Add(stun.AttrReservationToken, )return nil}// GetFrom decodes RESERVATION-TOKEN from message.func ( *ReservationToken) ( *stun.Message) error {, := .Get(stun.AttrReservationToken)if != nil {return}if = stun.CheckSize(stun.AttrReservationToken, len(), reservationTokenSize); != nil {return}* =return nil}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |