RE: Is it possible to write an OWIN-compliant HTTP Server that rigorously supports pipelining

77 views
Skip to first unread message

Chris R

unread,
Feb 15, 2013, 12:04:36 PM2/15/13
to net-http-a...@googlegroups.com
1. Only requests without a body can be pipelined (right?), so nothing is blocking you from reading in the next request.
2. The end of the response is officially signaled by the completion of the AppFunc Task.  Tracking the content-length is also reasonable for your purposes (HttpListener does this internally).  The app is discouraged from closing the response stream because middleware may still need to write to it.

What difficulties are you seeing?


Date: Fri, 15 Feb 2013 05:35:51 -0800
From: gra...@openhome.org
To: net-http-a...@googlegroups.com
Subject: Is it possible to write an OWIN-compliant HTTP Server that rigorously supports pipelining

I ask this because I am finding it quite hard to do so.

Maybe I am misunderstanding something, but the OWIN API doesn't seem to help to make a completely efficient and robust solution possible.

It would be useful for a consumer of the OWIN API to explicitly indicate:

(1) When they have finished dealing with the request
        - so that the server can discard any part of the request body that has not already been consumed and continue to read the next request

(2) Whey they have finished dealing with the response
        - so that the server can safely start sending responses that may have been queued up for subsequent requests

It is possible in certain circumstances to infer these as follows:

(1) is implied if the request explicitly indicates a Content-Length of 0 bytes

(1) is implied if the consumer reads the last byte of the request body, as indicated by the request Content-Length header

(1) is implied If the consumer closes the RequestStream

(2) is implied if the consumer closes the ResponseStream

(1) AND (2) are implied if the request handling task completes

But is there not some enhancement to the OWIN API that could make this more rigorous.

I would be grateful for your thoughts

Graham


--
You received this message because you are subscribed to the Google Groups ".NET HTTP Abstractions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to net-http-abstrac...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply all
Reply to author
Forward
0 new messages