本文整理汇总了C#中ActorSystem.Tcp方法的典型用法代码示例。如果您正苦于以下问题:C# ActorSystem.Tcp方法的具体用法?C# ActorSystem.Tcp怎么用?C# ActorSystem.Tcp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActorSystem
的用法示例。
在下文中一共展示了ActorSystem.Tcp方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
/// <summary>
/// MultiNodeTestRunner takes the following <see cref="args"/>:
///
/// C:\> Akka.MultiNodeTestRunner.exe [assembly name] [-Dmultinode.enable-filesink=on] [-Dmultinode.output-directory={dir path}] [-Dmultinode.spec={spec name}]
///
/// <list type="number">
/// <listheader>
/// <term>Argument</term>
/// <description>The name and possible value of a given Akka.MultiNodeTestRunner.exe argument.</description>
/// </listheader>
/// <item>
/// <term>AssemblyName</term>
/// <description>
/// The full path or name of an assembly containing as least one MultiNodeSpec in the current working directory.
///
/// i.e. "Akka.Cluster.Tests.MultiNode.dll"
/// "C:\akka.net\src\Akka.Cluster.Tests\bin\Debug\Akka.Cluster.Tests.MultiNode.dll"
/// </description>
/// </item>
/// <item>
/// <term>-Dmultinode.enable-filesink</term>
/// <description>Having this flag set means that the contents of this test run will be saved in the
/// current working directory as a .JSON file.
/// </description>
/// </item>
/// <item>
/// <term>-Dmultinode.multinode.output-directory</term>
/// <description>Setting this flag means that any persistent multi-node test runner output files
/// will be written to this directory instead of the default, which is the same folder
/// as the test binary.
/// </description>
/// </item>
/// <item>
/// <term>-Dmultinode.listen-address={ip}</term>
/// <description>
/// Determines the address that this multi-node test runner will use to listen for log messages from
/// individual NodeTestRunner.exe processes.
///
/// Defaults to 127.0.0.1
/// </description>
/// </item>
/// <item>
/// <term>-Dmultinode.listen-port={port}</term>
/// <description>
/// Determines the port number that this multi-node test runner will use to listen for log messages from
/// individual NodeTestRunner.exe processes.
///
/// Defaults to 6577
/// </description>
/// </item>
/// <item>
/// <term>-Dmultinode.spec={spec name}</term>
/// <description>
/// Setting this flag means that only tests which contains the spec name will be executed
/// otherwise all tests will be executed
/// </description>
/// </item>
/// </list>
/// </summary>
static void Main(string[] args)
{
OutputDirectory = CommandLine.GetProperty("multinode.output-directory") ?? string.Empty;
TestRunSystem = ActorSystem.Create("TestRunnerLogging");
SinkCoordinator = TestRunSystem.ActorOf(Props.Create<SinkCoordinator>(), "sinkCoordinator");
var listenAddress = IPAddress.Parse(CommandLine.GetPropertyOrDefault("multinode.listen-address", "127.0.0.1"));
var listenPort = CommandLine.GetInt32OrDefault("multinode.listen-port", 6577);
var listenEndpoint = new IPEndPoint(listenAddress, listenPort);
var specName = CommandLine.GetPropertyOrDefault("multinode.spec", "");
var tcpLogger = TestRunSystem.ActorOf(Props.Create(() => new TcpLoggingServer(SinkCoordinator)), "TcpLogger");
TestRunSystem.Tcp().Tell(new Tcp.Bind(tcpLogger, listenEndpoint));
var assemblyName = Path.GetFullPath(args[0]);
EnableAllSinks(assemblyName);
PublishRunnerMessage(String.Format("Running MultiNodeTests for {0}", assemblyName));
using (var controller = new XunitFrontController(assemblyName))
{
using (var discovery = new Discovery())
{
controller.Find(false, discovery, TestFrameworkOptions.ForDiscovery());
discovery.Finished.WaitOne();
foreach (var test in discovery.Tests.Reverse())
{
if (!string.IsNullOrEmpty(test.Value.First().SkipReason))
{
PublishRunnerMessage(string.Format("Skipping test {0}. Reason - {1}", test.Value.First().MethodName, test.Value.First().SkipReason));
continue;
}
if (!string.IsNullOrWhiteSpace(specName) && !test.Value[0].MethodName.Contains(specName))
continue;
PublishRunnerMessage(string.Format("Starting test {0}", test.Value.First().MethodName));
var processes = new List<Process>();
//.........这里部分代码省略.........