|SignalR Owin Host||David Fowler||12/31/11 3:45 PM|
Over the past few days I've done some work to decouple SignalR from
ASP.NET (yay). Now I'm trying to implement an OWIN host and I'm having
some difficulty making it work under Kayak. The code for the host is
Other related classes are here:
The code I'm using to test it is here:
When I run the server and send requests from the signalr client, the
continuation for reading the request body is never called. Louis
( pointed out that it might have something to do with the Owin host
(in this case Kayak) might be using the single threaded event loop
scheduler and my code isn't friendly for that (https://twitter.com/#!/
How do I make this work?
|Re: SignalR Owin Host||Louis DeJardin||1/1/12 1:22 AM|
That's very peculiar.
I pushed an update of Gate bits for v0.2.0, and also forked SignalR to update the Gate references and code in the SignalR owin branch.
One thing I noticed - it seems to be able to get past the POST to "/negotiate" if you comment out the .RescheduleCallbacks() middleware. Not sure why that is - but that will get you to the next GET to "/connect" which doesn't return a result.
For that - even with the reschedule middleware commented out - the eventKey "SignalrKayakGateDemo.Raw" in the InProcessSignalBus seems to arrive at the OnSignaled method before the AddHandler method. It looks like Kayak has a custom TaskScheduler in effect? Maybe a subtle race condition that the custom scheduler will repro consistently?
I'll look further - feel free to clone the loudej/signalr to checkout owin branch.
|Re: SignalR Owin Host||Benjamin van der Veen||1/1/12 2:08 PM|
On Sat, Dec 31, 2011 at 3:45 PM, David Fowler <davi...@gmail.com> wrote:> https://github.com/SignalR/SignalR/blob/owin/SignalR.Owin/OwinHost.cs
If your intention is to buffer the request body into a string, you
> When I run the server and send requests from the signalr client, the
Sorry, which callback exactly isn't being invoked as expected?
|Re: SignalR Owin Host||David Fowler||1/1/12 2:41 PM|
Thanks for that, i'll change it once I get something basic working. If
you look at the host code, there's a ParseBodyAsync method:
private static Task<string> ParseBodyAsync(IDictionary<string, object>
var requestBodyDelegate = GetRequestBodyDelegate(environment);
var tcs = new TaskCompletionSource<string>();
if (requestBodyDelegate == null)
string text = null;
requestBodyDelegate.Invoke((data, continuation) =>
// TODO: Check the continuation and read async if it isn't
text = Encoding.UTF8.GetString(data.Array, data.Offset,
() => tcs.SetResult(text));
None of the callbacks seemed to be called so it's just hanging.
On Jan 1, 2:08 pm, Benjamin van der Veen <b...@bvanderveen.com> wrote:
|Re: SignalR Owin Host||Benjamin van der Veen||1/1/12 9:11 PM|
On Jan 1, 2012, at 2:41 PM, David Fowler <davi...@gmail.com> wrote:
> None of the callbacks seemed to be called so it's just hanging.
That's strange. Hmm...The request body delegate in non-null and your client is posting non-zero-length data?
|Re: SignalR Owin Host||David Fowler||1/2/12 6:08 AM|
|RE: SignalR Owin Host||Louis DeJardin||1/2/12 11:36 AM|
It there's a non-null body delegate you should get one callback to
error or complete, at a minimum.
|Re: SignalR Owin Host||David Fowler||1/2/12 11:38 AM|
Yea, it's just not working.
|Re: SignalR Owin Host||Benjamin van der Veen||1/2/12 12:07 PM|
Try compiling Kayak from the latest master.
|RE: SignalR Owin Host||Louis DeJardin||1/2/12 3:13 PM|
Yeah, I'll try running the whole stack from source under debugger...
SignalR's a great test-case, really. Very extreme requirements.
|Re: SignalR Owin Host||Scott Koon||1/6/12 11:25 AM|
I think it's great that David took the time and effort to get this running under Kayak and OWIN/Gate. Always good to get folks "road testing" the spec.
|RE: SignalR Owin Host||Louis DeJardin||1/6/12 11:47 AM|
Say, David, are you unblocked by what was pushed up, or are you still waiting for something?
From: net-http-a...@googlegroups.com [mailto:net-http-a...@googlegroups.com]
On Behalf Of Scott Koon
|Re: SignalR Owin Host||David Fowler||1/7/12 8:32 AM|
Your fork helps alot, thanks Louis. I'll see what I can do from there.
> On Mon, Jan 2, 2012 at 3:13 PM, Louis DeJardin <louis.dejar...@gmail.com<mailto:louis.dejar...@gmail.com>> wrote:
|Re: SignalR Owin Host||Louis DeJardin||1/9/12 1:44 PM|
Sounds good. Something I noticed is you may need an End() on your
IResponse abstraction. It was pretty difficult to know which data
writes were intended to end the http response, and which were intended
to flush to the wire but remain writable.