示例#1
0
 public void RegisterResource(Models.Api.Resource resource)
 {
     if (!m_gatewayClients.ContainsKey(resource.Uri))
     {
         var client = new GatewaySocketClient(resource.Uri);
         m_gatewayClients.Add(resource.Uri, client);
     }
 }
示例#2
0
        public void UnregisterOnMessageEvent(Guid resourceId, MessageReceivedHandler handler)
        {
            GatewaySocketClient client = null;

            if (m_gatewayClients.TryGetValue(GetResourceUri(resourceId), out client))
            {
                client.OnMessageReceived -= handler;
            }
        }
示例#3
0
        public Guid SendSetCommunicationModeRequest(Guid resourceId, CommunicationMode mode)
        {
            GatewaySocketClient client = null;
            Guid requestGuid           = Guid.Empty;

            if (m_gatewayClients.TryGetValue(GetResourceUri(resourceId), out client))
            {
                requestGuid = client.SendSetCommunicationMode(resourceId, mode);
            }

            return(requestGuid);
        }
示例#4
0
        public Guid SendGetResourceDataRequest(Guid resourceId, INotifiableRequester sender)
        {
            GatewaySocketClient client = null;
            Guid requestGuid           = Guid.Empty;

            if (m_gatewayClients.TryGetValue(GetResourceUri(resourceId), out client))
            {
                requestGuid = client.SendGetResourceDataRequest(resourceId, sender);
            }

            return(requestGuid);
        }