マイクロコントローラー (Texas Instruments CC3100 wifi チップを使用) に応答を提供する Web サイト (Azure 上の c#) を作成しました。
マイクロコントローラのメモリは限られているため、バッファ サイズを 1000 バイト未満に制限したいと考えています。Transfer encoding Chunked を使用できます (動作します) が、「TCP/IP ボンネットの下」に設定されているように見えるため、最大チャンク サイズを設定する方法を見つけるのに苦労しています。
私の現在の短縮コードは次のとおりです: -
public class HITController : ApiController
{
public async Task<HttpResponseMessage> Post()
{
byte[] RetContent = null;
byte[] bytes = await Request.Content.ReadAsByteArrayAsync();//do stuff with incoming bytes
RetContent = responseSelect(SiteSN, inData);//this gets a byte array of content to return
HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK);
result.StatusCode = HttpStatusCode.OK;
ByteArrayContent ResponseContent = new ByteArrayContent(RetContent);
result.Content = ResponseContent;
result.Content.Headers.ContentType = new MediaTypeHeaderValue("application/x-www-form-urlencoded");
result.Headers.TransferEncodingChunked = true;
return result;
}
}
私が見る限り、チャンクサイズを制限するサーバーまたはヘッダー設定はありません。小さなチャンクサイズを強制する方法はありますか (ある種の書き込みに続いてフラッシュが行われる可能性がありますか?)。
どんな助けでも大歓迎です。