/// <summary> /// Invokes the method from the message on the handler object and sends back the return value /// </summary> public static async void HandleRequest(AppServiceRequest request, object handler, string message) { var invoker = new ChannelInvoker(handler); var result = invoker.ProcessRequest(message); await SendResponse(request, result); }
public static void PublishError(Type channelType, Exception error) { Guard.ArgumentNotNull(channelType, "channelType"); ChannelInvoker _invoker = GetChannelInvoker(channelType); _invoker.PublishError(error, false); }
public static void Publish(Type channelType, string key, Object payload, bool asynchronously) { Guard.ArgumentNotNull(channelType, "channelType"); ChannelInvoker _invoker = GetChannelInvoker(channelType); _invoker.Publish(key, payload, asynchronously); }
public static void Publish(Type channelType, string key, Object payload) { Guard.ArgumentNotNull(channelType, "channelType"); ChannelInvoker _invoker = GetChannelInvoker(channelType); _invoker.Publish(key, payload, false); }
public static Object GetChannel(Type channelType, string key) { Guard.ArgumentNotNull(channelType, "channelType"); ChannelInvoker _invoker = GetChannelInvoker(channelType); return(_invoker.GetChannel(key)); }
public static void PublishError(Type channelType, string key, Exception error, bool asynchronously) { Guard.ArgumentNotNull(channelType, "channelType"); ChannelInvoker _invoker = GetChannelInvoker(channelType); _invoker.PublishError(key, error, asynchronously); }
public static IDisposable Subscribe(Type channelType, Object subscriber, ThreadOption threadOption, bool useWeakReference) { Guard.ArgumentNotNull(channelType, "channelType"); Guard.ArgumentNotNull(subscriber, "subscriber"); ChannelInvoker _invoker = GetChannelInvoker(channelType); return(_invoker.Subscribe(subscriber, threadOption, useWeakReference)); }
public SignalingClient(ISignalingSocketService signalingSocketService, IForegroundChannel foregroundChannel, IVoipChannel voipChannel) { _signalingSocketService = signalingSocketService; _voipChannel = voipChannel; _foregroundChannel = foregroundChannel; ServerChannelInvoker = new ChannelInvoker(this); }
public void WaitForRegistration() { Task.Run(async() => { var reader = new StreamReader(TcpClient.GetStream()); var clientChannelProxy = new ChannelInvoker(this); var message = await reader.ReadLineAsync(); if (!clientChannelProxy.ProcessRequest(message).Invoked) { OnInvalidRequest(InvalidMessage.For(message)); } }); }
private static ChannelInvoker GetChannelInvoker(Type channelType) { ChannelInvoker _invoker = null; lock (_lock) { if (!_invokers.TryGetValue(channelType, out _invoker)) { var _channelInvokerType = _invokerGenericType.MakeGenericType(channelType); _invoker = (ChannelInvoker)Activator.CreateInstance(_channelInvokerType); if (!_invokers.ContainsKey(channelType)) { _invokers.Add(channelType, _invoker); } } } return(_invoker); }
public void WaitForRegistration() { Task.Run(async() => { var reader = new StreamReader(TcpClient.GetStream()); var clientChannelProxy = new ChannelInvoker(this); string message; do { message = await reader.ReadLineAsync(); Logger.Info(message); } while (!message.ToUpper().StartsWith(nameof(RegisterAsync).ToUpper())); if (!clientChannelProxy.ProcessRequest(message).Invoked) { await OnInvalidRequest(InvalidMessage.For(message)).CastToTask(); } }); }
public RegisteredClient() { ClientReadProxy = new ChannelInvoker(this); }
public I Install(ChannelFactory <I> factory, ProxyRemotingInvoker remotingInvoker) { ChannelInvoker invoker = new ChannelInvoker(typeof(I), factory, remotingInvoker); return(invoker.GetTransparentProxy() as I); }
public ChatterBoxConsoleClient() { ServerReadProxy = new ChannelInvoker(this); }