defulatModule.AddCmdProcessor<Close>();
defulatModule.Build();
defulatModule.Run();
var serverModule = new ServerCmdModule(50000);
serverModule.AddCmdProcessor<Close>();
serverModule.Build();
serverModule.Run();
var client = new ClientCmdModule("127.0.0.1", 50000);
client.Build();
client.Run();
var local = new LocalCmdModule();
local.Build();
local.Run();
[CmdAttribute("close")]
internal class Close : ICmdProcessor
{
public Task InvokeAsync(string[] args)
{
Process.GetCurrentProcess().Close();
return Task.CompletedTask;
}
public string Print()
{
return "close process";
}
}
//...
cli.AddCmdProcessor<Close>();
cli.Build();
cli.Run();
? - Cmd List
Ctrl + C - Command Stop