public bool Subscribe(ServiceClient clientData)
 {
     // TODO Unsubscribe client after some amount of time no ping
     clientData.Callback =
         OperationContext.Current.GetCallbackChannel<IEveAPIService>();
     return RelayManager.RegisterClient(clientData);
 }
Exemple #2
0
        /// <summary>
        /// Registers new Service Client
        /// </summary>
        /// <param name="client">Service Client object to register</param>
        /// <returns>
        /// Returns true if Service Client isn't 
        /// already registered nor null
        /// </returns>
        public static bool RegisterClient(ServiceClient client)
        {
            if (client == null ||
                RelayManager.Clients.ContainsKey(client.ID))
                return false;

            RelayManager.Clients.Add(client.ID, client);
            return true;
        }
 // TODO rename to Unsubscribe
 public bool Unsibscribe(ServiceClient clientData)
 {
     return RelayManager.UnregisterClient(clientData.ID);
 }