Ejemplo n.º 1
0
        public Task <MethodResult <DictionaryData> > GetEvents(ClientConnection clt, Empty empty)
        {
            DictionaryData dd = new DictionaryData();

            foreach (var info in _events)
            {
                dd.Data.Add(info.Key, info.Value.PayloadType);
            }

            return(Task.FromResult(MethodResult <DictionaryData> .FromResult(dd)));
        }
Ejemplo n.º 2
0
        public Task <MethodResult <MethodInfo> > GetMethodInfo(ClientConnection clt, Payloads.Generic.String ep)
        {
            if (!_clientMethods.ContainsKey(ep.Value))
            {
                return(Task.FromResult(MethodResult <MethodInfo> .FromError("Method endpoint unknown")));
            }

            return(Task.FromResult(MethodResult <MethodInfo> .FromResult(new MethodInfo()
            {
                EndPoint = ep.Value,
                ParamPayloadType = _clientMethods[ep.Value].ParamPayloadType,
                ResultPayloadType = _clientMethods[ep.Value].ResultPayloadType
            }
                                                                         )));
        }
Ejemplo n.º 3
0
        public Task <MethodResult <StringList> > GetEventPublishers(ClientConnection clt, Payloads.Generic.String ep)
        {
            StringList sl = new StringList();

            if (!_events.ContainsKey(ep.Value))
            {
                return(Task.FromResult(MethodResult <StringList> .FromError("Event EndPoint unknown")));
            }

            foreach (ClientConnection connection in _events[ep.Value].Publishers)
            {
                sl.List.Add(connection.EndPoint.ToString());
            }

            return(Task.FromResult(MethodResult <StringList> .FromResult(sl)));
        }
Ejemplo n.º 4
0
        public Task <MethodResult <MethodInfoList> > GetMethods(ClientConnection clt, Empty e)
        {
            MethodInfoList l = new MethodInfoList();

            l.List.AddRange(_serverMethods.Methods.Select(i => new MethodInfo()
            {
                EndPoint          = i.Key,
                ParamPayloadType  = i.Value.ParameterPayloadType,
                ResultPayloadType = i.Value.ResultPayloadType
            }));

            l.List.AddRange(_clientMethods.Select(kvp => new MethodInfo()
            {
                EndPoint          = kvp.Key,
                ParamPayloadType  = kvp.Value.ParamPayloadType,
                ResultPayloadType = kvp.Value.ResultPayloadType
            }));

            return(Task.FromResult(MethodResult <MethodInfoList> .FromResult(l)));
        }
Ejemplo n.º 5
0
 private Task <MethodResult <Empty> > GetEmptySuccessMessage()
 {
     return(Task.FromResult(MethodResult <Empty> .FromResult(new Empty())));
 }