Does service bus relay support async wcf operations?
I get the server failed to return a meaningful response with the following code. If I change the timespan to 30 seconds though it works fine.
started by following this tutorial http://azure.microsoft.com/en-us/documentation/articles/service-bus-dotnet-how-to-use-relay
Client code:
var task = Task<string>.Factory.FromAsync(channel.BeginDoEcho, channel.EndDoEcho, input, null);
Console.WriteLine("Server echoed: {0}", task.Result );
Server code:
public IAsyncResult BeginDoEcho(string text, AsyncCallback callback, object state)
{
var task = Task<string>.Factory.StartNew(x =>
{
Thread.Sleep(TimeSpan.FromMinutes(5));
return text;
}, state);
return task.ContinueWith(result => callback(task));
}
public string EndDoEcho(IAsyncResult result)
{
return ((Task<string>) result).Result;
}