-
-
Notifications
You must be signed in to change notification settings - Fork 295
Expand file tree
/
Copy pathProgram.cs
More file actions
44 lines (39 loc) · 1.26 KB
/
Program.cs
File metadata and controls
44 lines (39 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// -----------------------------------------------------------------------
// <copyright file="Program.cs" company="Asynkron HB">
// Copyright (C) 2015-2017 Asynkron HB All rights reserved
// </copyright>
// -----------------------------------------------------------------------
using System;
using System.Threading.Tasks;
using Messages;
using Proto;
using Proto.Remote;
using ProtosReflection = Messages.ProtosReflection;
namespace Node2
{
class Program
{
static void Main(string[] args)
{
Serialization.RegisterFileDescriptor(ProtosReflection.Descriptor);
var props = Actor.FromFunc(ctx =>
{
switch (ctx.Message)
{
case HelloRequest msg:
ctx.Respond(new HelloResponse
{
Message = "Hello from node 2",
});
break;
default:
break;
}
return Actor.Done;
});
Remote.RegisterKnownKind("hello", props);
Remote.Start("127.0.0.1", 12000);
Console.ReadLine();
}
}
}