Option Strict On

Imports System.Runtime.Remoting
Imports Belikov
Imports Belikov.GenuineChannels
Imports Belikov.GenuineChannels.BroadcastEngine
Imports Belikov.GenuineChannels.DotNetRemotingLayer

Module SystemCoordinationServerEntryPoint

    Sub Main()

        Try
            Mbark.SystemCoordination.ConfigureRemoting()
            AddHandler GenuineGlobalEventProvider.GenuineChannelsGlobalEvent, New GenuineChannelsGlobalEventHandler(AddressOf GenuineChannelsEventHandler)
            Console.WriteLine("------------------")
            Console.WriteLine("System Coordinator")
            Console.WriteLine("------------------")

            Console.WriteLine("[ENTER] to dismiss")
            Console.ReadLine()
            Mbark.SystemCoordination.SystemCoordinator.SaveCurrentSettings()
        Catch ex As Exception
            Console.WriteLine(ex.Message)
            Console.WriteLine("--")
            Console.WriteLine(ex.StackTrace)
            Console.ReadLine()
        End Try



    End Sub

    Public Sub GenuineChannelsEventHandler(ByVal sender As Object, ByVal e As GenuineEventArgs)
        'Console.WriteLine("     Genuine Channel Event: [{0}]", e.EventType.ToString)
    End Sub
End Module

