gclib  2.0.8
Communications API for Galil controllers and PLCs
Remote_Server.vb
Go to the documentation of this file.
1 Partial Public Module Examples
2  ''' <summary>
3  ''' Demonstrates various uses of GPublishServer()
4  ''' </summary>
5  ''' <param name="server_name">The name to publish the server under.</param>
6  ''' <returns>The success status Or error code of the function.</returns>
7  ''' <remarks>See remote_server_example.cs for an example.</remarks>
8  Function Remote_Server(server_name As String) As Integer
9  Dim gclib = New Gclib()
10 
11  Console.WriteLine("<p> Publish this server to the network" + vbNewLine +
12  "<r> Remove this server from the network" + vbNewLine +
13  "<q> Quit")
14 
15  Dim loop_bool = True
16 
17  While loop_bool
18  Select Case Console.ReadKey(True).Key
19  Case ConsoleKey.Q
20  loop_bool = False
21  Case ConsoleKey.P
22  gclib.GPublishServer(server_name, True, False)
23  Console.WriteLine("Published Server")
24  Case ConsoleKey.R
25  gclib.GPublishServer(server_name, False, False)
26  Console.WriteLine("Removed Server")
27  End Select
28 
29  End While
30 
31  Return Examples.GALIL_EXAMPLE_OK
32  End Function
33 End Module
Provides a class of shared constants and methods for gclib's example projects.
Definition: commands.cs:16
Provides a class that binds to gclib's unmanaged dll. Wraps each call and provides a more user-friend...
Definition: gclib.cs:68
GCLIB_DLL_EXPORTED GReturn GCALL GPublishServer(GCStringIn name, GOption publish, GOption save)
Uses GUtility(), G_UTIL_GCAPS_PUBLISH_SERVER to publish local gcaps server to the local network.
Definition: gclibo.c:189
void error(GCon g, GReturn rc)
An example of error handling and debugging information.
Definition: examples.h:40
int Remote_Server(string server_name)
Demonstrates various uses of GPublishServer()
partial Module Examples
Definition: Commands.vb:4