Message length is the total length of the message, in bytes. Protocol type allows each type of server using this transfer syntax to define a different format for the protocol data. DXP has been assigned protocol type 3. Protocol data is the rest of the response or request. It is variable length.
Some requests result in multiple responses.
This is particularly the case when a response needs to send more than 1024 bytes which is the message limit. The communication is originated by the client and may be terminated by either party. The server may send messages asynchronously to the client, for example, to ask the client to display a message to the user. If so, the message is valid so far, if not, reject the message. Extract the message length from the next WORD and read through to the message end.