We already created a Remote Type Object RemoteTime in the previous section. We have to create a listener Object for enable Objects in other application domains to create instances of this object (RemoteTime) Remotely. When creating a listener Object we have to choose and register a channel for handle the networking protocol and serialization formats and register the Type with the .NET Remoting system, so that it can use the channel to listen for requests for the Type. Channels are Objects that responsible of handling the network protocols and serialization formats.
In the following example we are creating a listener application TimeListener . It will act as a listener Object for the Remote Type RemoteTime. The Listener class TimeListener must be able to find the TimeListener.exe.config file to load the configuration for the RemotableType class.
Imports System
Imports System.Runtime.Remoting
Public Class TimeListener
Public Shared Sub Main()
RemotingConfiguration.Configure("TimeListener.exe.config")
Console.WriteLine("Listening for requests from the Client. Press Enter to exit...")
Console.ReadLine()
End Sub
End Class