forked from acdvorak/named-pipe-wrapper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
28 lines (26 loc) · 777 Bytes
/
Program.cs
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ExampleCLI
{
class Program
{
private const string DefaultPipeName = "MyServerPipe";
static void Main(string[] args)
{
if (args.Length >= 1 && string.Equals("/server", args[0], StringComparison.OrdinalIgnoreCase))
{
Console.WriteLine("Running in SERVER mode");
Console.WriteLine("Press 'q' to exit");
new MyServer(DefaultPipeName);
}
else
{
Console.WriteLine("Running in CLIENT mode");
Console.WriteLine("Press 'q' to exit");
new MyClient(DefaultPipeName);
}
}
}
}