| gclib 2.0.7 Communications API for Galil controllers and PLCs |

remote_server_example.cs
Go to the documentation of this file.
1
11 using System;
12 using System.Linq;
13
14 namespace examples
15 {
23
24 class Remote_Server_Example
25 {
32 public static int Main(string[] args)
33 {
34 int rc = Examples.GALIL_EXAMPLE_OK;
35
36 try
37 {
38 string server_name;
39
40 if (args.Count() < 1)
41 {
42 Console.Write("Enter server name: ");
43 server_name = Console.ReadLine();
44 }
45 else
46 {
47 server_name = args[0];
48 }
49
50 rc = Examples.Remote_Server(server_name);
51 }
52 catch (Exception ex)
53 {
54 Console.WriteLine(ex.Message);
55 rc = Examples.GALIL_EXAMPLE_ERROR;
56 }
57
58 Console.Write("\nPress any key to close the example");
59 Console.ReadKey();
60
61 return rc;
62 }
63 }
65 }
examples.Examples
Provides a class of shared constants and methods for gclib's example projects.
Definition: commands.cs:16
examples.Examples.GALIL_EXAMPLE_OK
const int GALIL_EXAMPLE_OK
Examples success code.
Definition: examples.cs:29
examples.Examples.GALIL_EXAMPLE_ERROR
const int GALIL_EXAMPLE_ERROR
Examples error code.
Definition: examples.cs:30
examples.Remote_Server_Example.Main
static int Main(string[] args)
Main function for the Remote Server example.
Definition: remote_server_example.cs:32
examples.Remote_Server_Example
Demonstrates various uses of GPublishServer()
Definition: remote_server_example.cs:25
examples.Examples.Remote_Server
static int Remote_Server(string server_name)
Accepts user input to publish or remove local gcaps server from the network.
Definition: Remote_Server.cs:32
examples
Definition: commands.cs:14