Пример #1
0
	static void Main(string[] args)
	{
		var ctx = new ServiceContext();
		var service = new AgentService();
		service.Launch(12000);
		ctx.Run();
	}
Пример #2
0
	static void Main(string[] args)
	{
		var ctx = new ServiceContext();
		var service = new MailService();
		ctx.LaunchCmdline(typeof(ICmdline), service);
		service.Launch(8090);
		ctx.Run();
	}
Пример #3
0
	static void Main(string[] args)
	{
		if(args.Length != 1)
		{
			Log.Error("please input user name.");
			return;
		}
		var client = new Client();
		var ctx = new ServiceContext();
		var proxy = new IAgentServerProxy();
		proxy.RegisterCallback(client);
		proxy.Connect("127.0.0.1", 12000, ctx);
		proxy.Call.Login(args[0]);
		proxy.Call.GetMails(mails =>
		{
			foreach(var mail in mails)
			{
				Log.Info("Get mail: {0}", mail);
			}
		});
		ctx.Run();
	}