Пример #1
0
        public IPCServiceConn(oVpnConnetion oVpnConnetion)
        {
            this.oVpnConnetion         = oVpnConnetion;
            ServiceImplementation.conn = this;

            oVpnConnetion.onState += oVpnConnetion_onState;
            host = new ServiceHost(typeof(ServiceImplementation), new Uri(@"net.pipe://localhost/netfree-anywhere/"));
            host.AddServiceEndpoint(typeof(INfaServiceNotify), new NetNamedPipeBinding(), "control");
            host.Open();
        }
Пример #2
0
 static void Main(string[] args)
 {
     if (!Environment.UserInteractive)
     {
         var ind = new ServiceS();
         ServiceBase.Run(ind);
     }
     else
     {
         oVpnConnetion vpn = new oVpnConnetion();
         Console.Read();
         vpn.Disconnect();
     }
 }
Пример #3
0
        protected override void OnStart(string[] args)
        {
            Trace.WriteLine("start service OnStartPoint");
            base.OnStart(args);

            try
            {
                Trace.WriteLine("start the interface check");
                vpn = new oVpnConnetion();
            }
            catch (Exception ex)
            {
                Trace.TraceError("filed to create interface check instance. the error:\n" + ex.ToString());
                Stop();
            }
        }