You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DDS.Net.Server.**DdsServer** is the main entry-point of the library to execute the server for variables' exchange. Its constructor takes following parameters:
4
+
5
+
```csharp
6
+
DdsServer(
7
+
ServerConfigurationconfig,
8
+
VariablesConfigurationvariablesConfig)
9
+
```
10
+
11
+
12
+
13
+
As a simple use-case, the server can be executed as:
14
+
15
+
```csharp
16
+
usingDDS.Net.Server.Entities;
17
+
usingDDS.Net.Server.Interfaces;
18
+
usingDDS.Net.Server.Interfaces.DefaultLogger;
19
+
usingDDS.Net.Server.PublicExtensions;
20
+
usingDDS.Net.Server.PublicHelpers;
21
+
22
+
namespaceDDS.Net.Server.ConsoleApp
23
+
{
24
+
internalclassProgram
25
+
{
26
+
privatestaticConsoleLoggerlogger=
27
+
newConsoleLogger(LogLevel.Information);
28
+
privatestaticDdsServerserver=null!;
29
+
30
+
staticvoidMain(string[] args)
31
+
{
32
+
(boolisEnabled,
33
+
ServerConfiguration?config) =
34
+
ConfigurationProvider
35
+
.GetServerConfiguration("config.ini", logger);
36
+
37
+
if (isEnabled&&config!=null)
38
+
{
39
+
server=newDdsServer(
40
+
config,
41
+
ConfigurationProvider
42
+
.GetVariablesConfiguration(
43
+
"vars-config.ini", logger));
44
+
45
+
server.Start();
46
+
}
47
+
else
48
+
{
49
+
server=null!;
50
+
logger.Error("Failed to start the server.");
51
+
}
52
+
53
+
ConsoleHelpers
54
+
.WaitForKey("Press ESC to exit.", ConsoleKey.Escape);
0 commit comments