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}"); }
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); }
public bool TryPublishService <TRemoteService>(IApiIpcService ipcService) => TryPublishService(typeof(TRemoteService), ipcService);
private static Type GetInterfaceType(IApiIpcService apiService) => apiService.GetType().GetInterfaces().First(i => i != typeof(IApiIpcService));