3.1.5.2 Waiting for a Packet or a Response

This section specifies steps that MUST be performed when the client is expecting to receive a packet (see 2.2.3) or a response to a request (see section 2.2.2).

The client MUST wait for a packet or a response to be received and then process the following rules:

If the Expected-Packets variable specifies that a $C  packet is expected and a $C packet is received, then the packet MUST be processed according to the rules in section 3.1.5.14.

If the Expected-Packets variable specifies that a $D packet is expected and a $D packet is received, then the packet MUST be processed according to the rules in section 3.1.5.12.

If the Expected-Packets variable specifies that a $E packet is expected and a $E packet is received, then the packet MUST be processed according to the rules in section 3.1.5.13.

If the Expected-Packets variable specifies that a $H packet is expected and a $H packet is received, then the packet MUST be processed according to the rules in section 3.1.5.8.

If the Expected-Packets variable specifies that a $M packet is expected and a $M packet is received, then the packet MUST be processed according to the rules in section 3.1.5.7.

If the Expected-Packets variable specifies that a $P packet is expected and a $P packet is received, then the packet MUST be processed according to the rules in section 3.1.5.6.

If the Expected-Packets variable specifies that a $T packet is expected and a $T packet is received, then the packet MUST be processed according to the rules in section 3.1.5.10.

If a packet is received but the packet type is not included in the Expected-Packets variable, then this MUST be treated as an error.

If a response is received and the element at the head of the Expected-Reponses variable is Describe, then the element at the head of the Expected-Reponses variable MUST be removed and the response MUST be processed according to the rules in section 3.1.5.5.

If a response is received and the element at the head of the Expected-Reponses variable is GetContentInfo, then the element at the head of the Expected-Reponses variable MUST be removed and the response MUST be processed according to the rules in section 3.1.5.4.

If a response is received and the element at the head of the Expected-Reponses variable is KeepAlive, then the element at the head of the Expected-Reponses variable MUST be removed and the response MUST be processed according to the rules in section 3.1.5.16.

If a response is received and the element at the head of the Expected-Reponses variable is Log, then the element at the head of the Expected-Reponses variable MUST be removed and the response MUST be processed according to the rules in section 3.1.5.15.

If a response is received and the element at the head of the Expected-Reponses variable is Pipeline, then the element at the head of the Expected-Reponses variable MUST be removed and the response MUST be processed according to the rules in section 3.1.5.9.

If a response is received and the element at the head of the Expected-Reponses variable is Play, then the element at the head of the Expected-Reponses variable MUST be removed and the response MUST be processed according to the rules in section 3.1.5.11.

If a response is received and the element at the head of the Expected-Reponses variable is PlayNextEntry, then the element at the head of the Expected-Reponses variable MUST be removed and the response MUST be processed according to the rules in section 3.1.5.18.

If a response is received and the element at the head of the Expected-Reponses variable is SelectStream, then the element at the head of the Expected-Reponses variable MUST be removed and the response MUST be processed according to the rules in section 3.1.5.17.

If a response is received and the element at the head of the Expected-Reponses variable is SendEvent, then the element at the head of the Expected-Reponses variable MUST be removed and the response MUST be processed according to the rules in section 3.1.5.20.

If a response is received and the element at the head of the Expected-Reponses variable is Stop, then the element at the head of the Expected-Reponses variable MUST be removed and the response MUST be processed according to the rules in section 3.1.5.19.

If a response is received and the Expected-Responses variable is empty, then this MUST be treated as an error.