[Opensim-dev] HttpServer overview & RFC

Dr Scofield DrScofield at xyzzyxyzzy.net
Thu May 29 07:47:45 UTC 2008


Sean Dague wrote:
> On Wed, May 28, 2008 at 08:07:23AM +0200, Dr Scofield wrote:
>   
>>    hi all, another request for comments :-)
>>     
>
> First, +1 on the approach here.  A couple of questions / comments in
> line just to educate myself.
>
> [...]
> [...]
>>    == making use of HttpServer ==
>>    what i'd actually like to implement (either as an HttpModule or as an
>>    HttpListener handler) is an event--event handler scheme:
>>      * incoming HTTP request is pushed as an OSHttpRequest object into an
>>        HTTP request queue.
>>      * each OSHttpRequest encapsulates
>>
>>      * the HTTP request header,
>>      * an input stream fed by the remote client,
>>      * an output stream feeding the remote client
>>      * method to produce OSHttpResponse object (for signaling redirects,
>>        setting status codes, etc)
>>
>>      we have a pool of OSHttpRequest pumps that take OSHttpRequest objects
>>    and pump them via the registered event handlers to whoever registered
>>    an interest (via multicast mechanism that stefan already explained a
>>    couple of days ago as well)
>>
>>      event handlers return either
>>      * Pass --- didn't act on it
>>      * Handled --- acted on it, response return as out parameter
>>      * Detach --- acting on it, taking care of it myself, don't do
>>        anything
>>     
>
> Can you give an example of Handled vs. Detach usage?
>   
Handled: simple request for an item/an action, no streaming per se 
involved.
Detach: HTTP connection that we keep open; for example, "long poll" 
support: client connects, requests status update, OpenSim queues the 
request by detaching the OSHttpRequest from OSHttpServer and placing it 
in a queue. OSHttpServer happily continues, not sending anything back 
nor closing the input and output streams. eventually the event the 
client was interested in occurs, event handler goes through queue of, 
err, queued OSHttpRequests and responds --- optionally re-queuing the 
OSHttpRequest.

the detach usage still needs some further thoughts, i admit. but that's 
the direction i'd like to go with it.

i'll start adding an OSHttpServer and will flesh it out over the coming 
weeks.

    cheers,
    dr scofield

-- 
dr dirk husemann ---- virtual worlds research ---- ibm zurich research lab
SL: dr scofield ---- drscofield at xyzzyxyzzy.net ---- http://xyzzyxyzzy.net/
RL: hud at zurich.ibm.com - +41 44 724 8573 - http://www.zurich.ibm.com/~hud/




More information about the Opensim-dev mailing list