Skip to content

Commit

Permalink
Add endpointUriOverride to sample
Browse files Browse the repository at this point in the history
  • Loading branch information
luiscantero committed Dec 6, 2023
1 parent 0fea570 commit f60af41
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion samples/OpcPlcBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,16 @@ public class OpcPlcBase
{
/// <summary>
/// Initializes a new instance of the <see cref="OpcPlcBase"/> class.
/// Set the <paramref name="endpointUriOverride"/> to override spawning a server and use an existing one instead.
/// </summary>
public OpcPlcBase(string[] args, int port = 51234)
public OpcPlcBase(string[] args, int port, string? endpointUriOverride = null)
{
if(!string.IsNullOrEmpty(endpointUriOverride))
{
OpcPlcEndpointUrl = endpointUriOverride;
return;
}

// Passed args override the following defaults.
var serverTask = Task.Run(() => OpcPlc.Program.MainAsync(
args.Concat(
Expand Down

0 comments on commit f60af41

Please sign in to comment.