/// <summary> /// This method causes the communication listener to be opened. Once the Open /// completes, the communication listener becomes usable - accepts and sends messages. /// </summary> /// <param name="cancellationToken">Cancellation token</param> /// <returns> /// A <see cref="T:System.Threading.Tasks.Task">Task</see> that represents outstanding operation. The result of the Task is /// the endpoint string. /// </returns> public async Task <string> OpenAsync(CancellationToken cancellationToken) { var serviceName = this.parameters.ServiceName; var instanceId = this.parameters.InstanceId; var activation = this.parameters.CodePackageActivationContext; var node = await FabricRuntime.GetNodeContextAsync(TimeSpan.FromMinutes(1), cancellationToken); var nodeAddress = await GetNodeAddress(node.IPAddressOrFQDN); var siloEndpoint = new IPEndPoint(nodeAddress, activation.GetEndpoint("OrleansSiloEndpoint").Port); var proxyEndpoint = new IPEndPoint(nodeAddress, activation.GetEndpoint("OrleansProxyEndpoint").Port); var activeDeploymentId = deploymentId ?? OrleansFabricUtility.GetDeploymentId(serviceName); this.fabricSilo = new OrleansFabricSilo( serviceName, instanceId, siloEndpoint, proxyEndpoint, activeDeploymentId); this.MonitorSilo(); this.fabricSilo.Start(this.configuration); return(siloEndpoint.ToString()); }
/// <summary> /// This method causes the communication listener to be opened. Once the Open /// completes, the communication listener becomes usable - accepts and sends messages. /// </summary> /// <param name="cancellationToken">Cancellation token</param> /// <returns> /// A <see cref="T:System.Threading.Tasks.Task">Task</see> that represents outstanding operation. The result of the Task is /// the endpoint string. /// </returns> public async Task<string> OpenAsync(CancellationToken cancellationToken) { var serviceName = this.parameters.ServiceName; var instanceId = this.parameters.InstanceId; var activation = this.parameters.CodePackageActivationContext; var node = await FabricRuntime.GetNodeContextAsync(TimeSpan.FromMinutes(1), cancellationToken); var nodeAddress = await GetNodeAddress(node.IPAddressOrFQDN); var siloEndpoint = new IPEndPoint(nodeAddress, activation.GetEndpoint("OrleansSiloEndpoint").Port); var proxyEndpoint = new IPEndPoint(nodeAddress, activation.GetEndpoint("OrleansProxyEndpoint").Port); this.fabricSilo = new OrleansFabricSilo( serviceName, instanceId, siloEndpoint, proxyEndpoint, "UseDevelopmentStorage=true"); this.MonitorSilo(); this.fabricSilo.Start(this.configuration); return siloEndpoint.ToString(); }