-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
39 lines (36 loc) · 1.15 KB
/
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
29
30
31
32
33
34
35
36
37
38
39
namespace Hspi
{
/// <summary>
/// Class for the main program.
/// </summary>
public static class Program
{
/// <summary>
/// The homeseer server address. Defaults to the local computer but can be changed through the command line argument, server=address.
/// </summary>
private static string serverAddress = "127.0.0.1";
private const int serverPort = 10400;
/// <summary>
/// Defines the entry point of the application.
/// </summary>
/// <param name="args">Command line arguments</param>
private static void Main(string[] args)
{
// parse command line arguments
foreach (string sCmd in args)
{
string[] parts = sCmd.Split('=');
if (parts[0].ToUpperInvariant() == "SERVER")
{
serverAddress = parts[1];
}
}
using (var plugin = new ElasticsearchPlugin())
{
plugin.Connect(serverAddress, serverPort);
plugin.WaitforShutDownOrDisconnect();
}
}
}
}