' REMOTING CLIENT EXAMPLE CODE
Public WithEvents DataServiceSubscriber As ServiceSubscriber(Of INMServices) = Nothing
Public WithEvents DataService As INMServices = Nothing
' This object manages proxy and communications
DataServiceSubscriber = New ServiceSubscriber(Of INMServices)
' This creates a transparent proxy for the contract interface
DataService = DirectCast(DataServiceSubscriber.CreateProxy(), INMServices)
' With the above in place connect the subscriber to the server
If DataServiceSubscriber.Connect(srvr, NMDataServiceTCPPort) Then
DataServiceSubscriber.WaitForConnectionDisconnection(10000)
End If
' Now (as though it were a real class instance) invoke a method on the proxy,
' which actually is executed on the server... i.e. Register is a method
' defined in the INMServices contract interface. There is no local
' implementation. Rather the invocation is intercepted and put on the wire
' to the server.
DataService.Register(My.Computer.Name, Environment.UserName, ClientClassification.NMManager, My.Application.Info.AssemblyName)