Esempio n. 1
0
        public async Task PublishServiceAsync <TRemoteService>(IApiIpcService ipcService)
        {
            if (channelMutex == null)
            {
                await CreateServerAsync();
            }

            // Publish the ipc service receiving the data
            string ipcServiceName = ApiIpcCommon.GetServiceName <TRemoteService>(serverId);

            RemotingServices.Marshal(ipcService as ApiIpcService, ipcServiceName);

            Log.Debug($"Published: {ipcServiceName}");
        }
Esempio n. 2
0
        public bool TryPublishService(Type interfaceType, IApiIpcService ipcService)
        {
            if (channelMutex == null)
            {
                if (!TryCreateServer())
                {
                    return(false);
                }
            }

            // Publish the ipc service receiving the data
            string ipcServiceName = ApiIpcCommon.GetServiceName(interfaceType, serverId);

            RemotingServices.Marshal(ipcService as ApiIpcService, ipcServiceName);

            Log.Debug($"Published: {ipcServiceName}");
            return(true);
        }
Esempio n. 3
0
 public bool TryPublishService <TRemoteService>(IApiIpcService ipcService) =>
 TryPublishService(typeof(TRemoteService), ipcService);
 private static Type GetInterfaceType(IApiIpcService apiService) =>
 apiService.GetType().GetInterfaces().First(i => i != typeof(IApiIpcService));