pub async fn process<'a>(
ctx: Context,
reader: MessageReader<'_, '_>,
bytes: &'a mut BytesMut,
) -> Result<Option<Response<'a>>, StunError>
Expand description
process channel binding request
The server MAY impose restrictions on the IP address and port values allowed in the XOR-PEER-ADDRESS attribute; if a value is not allowed, the server rejects the request with a 403 (Forbidden) error.
If the request is valid, but the server is unable to fulfill the request due to some capacity limit or similar, the server replies with a 508 (Insufficient Capacity) error.
Otherwise, the server replies with a ChannelBind success response. There are no required attributes in a successful ChannelBind response.
If the server can satisfy the request, then the server creates or refreshes the channel binding using the channel number in the CHANNEL-NUMBER attribute and the transport address in the XOR-PEER- ADDRESS attribute. The server also installs or refreshes a permission for the IP address in the XOR-PEER-ADDRESS attribute as described in Section 9.
NOTE: A server need not do anything special to implement idempotency of ChannelBind requests over UDP using the “stateless stack approach”. Retransmitted ChannelBind requests will simply refresh the channel binding and the corresponding permission. Furthermore, the client must wait 5 minutes before binding a previously bound channel number or peer address to a different channel, eliminating the possibility that the transaction would initially fail but succeed on a retransmission.