mirror of https://github.com/ogoun/Zero.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
817 B
28 lines
817 B
using System;
|
|
using System.Net;
|
|
using ZeroLevel;
|
|
|
|
namespace TestApp
|
|
{
|
|
internal static class Program
|
|
{
|
|
private static void Main(string[] args)
|
|
{
|
|
var se = Bootstrap.Startup<MyService>(args,
|
|
() => Configuration.ReadSetFromIniFile("config.ini"))
|
|
.ReadServiceInfo()
|
|
//.UseDiscovery()
|
|
.Run();
|
|
|
|
var router = se.Service.UseHost(8800);
|
|
router.RegisterInbox<string, string>("upper", (c, s) => s.ToUpperInvariant());
|
|
|
|
var client = se.Service.ConnectToService(new IPEndPoint(IPAddress.Loopback, 8800));
|
|
client.Request<string, string>("upper", "hello", s => Console.WriteLine(s));
|
|
|
|
se.WaitWhileStatus(ZeroServiceStatus.Running)
|
|
.Stop();
|
|
}
|
|
}
|
|
}
|