1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- /******************************************************************************
- ** Copyright (c) 2006-2018 Unified Automation GmbH All rights reserved.
- **
- ** Software License Agreement ("SLA") Version 2.7
- **
- ** Unless explicitly acquired and licensed from Licensor under another
- ** license, the contents of this file are subject to the Software License
- ** Agreement ("SLA") Version 2.7, or subsequent versions
- ** as allowed by the SLA, and You may not copy or use this file in either
- ** source code or executable form, except in compliance with the terms and
- ** conditions of the SLA.
- **
- ** All software distributed under the SLA is provided strictly on an
- ** "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
- ** AND LICENSOR HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
- ** LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
- ** PURPOSE, QUIET ENJOYMENT, OR NON-INFRINGEMENT. See the SLA for specific
- ** language governing rights and limitations under the SLA.
- **
- ** Project: .NET based OPC UA Client Server SDK
- **
- ** Description: OPC Unified Architecture Software Development Kit.
- **
- ** The complete license agreement can be found here:
- ** http://unifiedautomation.com/License/SLA/2.7/
- ******************************************************************************/
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using UnifiedAutomation.UaBase;
- using UnifiedAutomation.UaServer;
- namespace acdp
- {
- class Program
- {
- static void Main(string[] args)
- {
- try
- {
- // The license file must be loaded from an embedded resource.
- ApplicationLicenseManager.AddProcessLicenses(System.Reflection.Assembly.GetExecutingAssembly(), "License.lic");
- // Start the server.
- Console.WriteLine("Starting Server.");
- AcdpServerManager server = new AcdpServerManager();
- ApplicationInstance.Default.Start(server, null, server);
- // print the endpoints.
- Console.WriteLine(string.Empty);
- Console.WriteLine("Listening at the following endpoints:");
- foreach (EndpointDescription endpoint in ApplicationInstance.Default.Endpoints)
- {
- StatusCode error = server.Application.GetEndpointStatus(endpoint);
- Console.WriteLine(" {0}: Status={1}", endpoint, error.ToString(true));
- }
- Console.WriteLine(string.Empty);
- // Block until the server exits.
- Console.WriteLine("Press <enter> to exit the program.");
- Console.ReadLine();
- // Stop the server.
- Console.WriteLine("Stopping Server.");
- server.Stop();
- }
- catch (Exception e)
- {
- Console.WriteLine("ERROR: {0}", e.Message);
- Console.WriteLine("Press <enter> to exit the program.");
- Console.ReadLine();
- }
- }
- }
- }
|