public async void Call(IWampClient client, string callId, string procUri, params TMessage[] arguments) #endif { procUri = ResolveUri(client, procUri); IWampRpcMethod method = mRpcMetadataCatalog.ResolveMethodByProcUri(procUri); try { WampRequestContext.Current = new WampRequestContext(client); object[] parameters = arguments.Zip(method.Parameters, (argument, type) => mFormatter.Deserialize(type, argument)) .ToArray(); #if !NET45 InnerCall(client, callId, method.InvokeAsync(client, parameters)); } #else object result = await method.InvokeAsync(client, parameters).ConfigureAwait(false); client.CallResult(callId, result); }
public async void Call(IWampClient client, string callId, string procUri, params TMessage[] arguments) { procUri = ResolveUri(client, procUri); IWampRpcMethod method = mRpcMetadataCatalog.ResolveMethodByProcUri(procUri); try { WampRequestContext.Current = new WampRequestContext(client); object[] parameters = arguments.Zip(method.Parameters, (argument, type) => mFormatter.Deserialize(type, argument)) .ToArray(); object result = await method.InvokeAsync(client, parameters).ConfigureAwait(false); client.CallResult(callId, result); } catch (Exception ex) { HandleException(client, callId, ex); } finally { WampRequestContext.Current = null; } }