-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProgram.cs
More file actions
25 lines (24 loc) · 849 Bytes
/
Program.cs
File metadata and controls
25 lines (24 loc) · 849 Bytes
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
using System;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using DCS.Lua.Connector;
namespace DCS.Lua.InteractiveConsole {
static class Program {
public static LuaConnector LuaConnector;
static async Task Main(string[] args) {
using (LuaConnector = new LuaConnector(IPAddress.Loopback, 5000)) {
LuaConnector.Timeout = TimeSpan.FromSeconds(5);
while (true) {
Console.Write("> ");
var command = Console.ReadLine();
try {
Console.WriteLine(await LuaConnector.SendReceiveCommandAsync(command));
} catch (TimeoutException) {
Console.WriteLine("Command timed out");
}
}
}
}
}
}