Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What is the need for content-length when we already know the length of payload using transport primitives?

0
Posted

What is the need for content-length when we already know the length of payload using transport primitives?

0

A. A tranport primitive like ‘recv’ is a system call implemented by operating system and is transparent to the application layer. A typical OS (like linux) can have the ‘recv’ return all the pending buffer in the network queue. This will result, for e.g., in two SIP messages being received simultaneosly in a single call to recv. Thus, we have content-length, so we can appropriately mark the sentinels of a SIP message. In another case we can have the same message split up into two different recv calls in which case, reassembly is needed.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123