1

I have an Azure application that connects to a large installed base of devices. Everything has been working fine for years until today when everything has stopped working. What I think has happened is Azure is now segmenting the small (87 byte payload) message and this has exposed a bug in my TCP handler.

Does anyone know if there is a way of forcing Azure not to segment small TCP messages?

Follow up - I think this is because the HTTP message is 'chunked' and send as 2 TCP segments. There is a bug in my code that does not handle chunks which as only now surfaced.

Can I turn off chunking in Azure?

BillBob
  • 67
  • 4

2 Answers2

0

If your question is whether there is a way to prevent a HTTP response from using HTTP Chunked Transfer Encoding, then perhaps, depending on the server-side APIs you are using. Setting a Content-Length header usually suffices.

But I think your question is whether you can force Azure to buffer IP packets in a way that avoids the bug in your client, which is assuming that a single socket Read() will return a complete message. In which case, no. It may not even be within Azure's control, as any intermediate router could cause a delay in the delivery of packets, which, in turn, will cause the client's Read() to return a partial message.

David Browne - Microsoft
  • 80,331
  • 6
  • 39
  • 67
0

I found a solution here Disable chunking in Asp.Net Core

In summary:

response.Headers["Content-Encoding"] = "identity";
response.Headers["Transfer-Encoding"] = "identity";

This seems to disable unnecessary chunking. I have no idea how

BillBob
  • 67
  • 4