예제 #1
0
        public void Start()
        {
            try
            {
                string[] args = Environment.GetCommandLineArgs();

                this.host           = WisejHost.Create();
                this.host.Shutdown += Host_Shutdown;
                this.host.Start(GetDomainName(args), GetPortNumber(args));
            }
            catch (Exception ex)
            {
                if (ex.InnerException != null)
                {
                    ex = ex.InnerException;
                }

                if (Environment.UserInteractive)
                {
                    WinForms.MessageBox.Show(ex.Message, ex.GetType().Name, WinForms.MessageBoxButtons.OK, WinForms.MessageBoxIcon.Error);
                }

                throw;
            }
        }
예제 #2
0
        public void StartServer()
        {
            string[] args = Environment.GetCommandLineArgs();

            this.host = WisejHost.Create();
            this.host.Start(GetDomainName(args), GetPortNumber(args));
        }
예제 #3
0
        public Task <string> OpenAsync(CancellationToken cancellationToken)
        {
            var endpoint = this.context.CodePackageActivationContext.GetEndpoint("ServiceEndpoint");

            this.wisejHost = WisejHost.Create();
            this.wisejHost.Start(this.context.NodeContext.IPAddressOrFQDN, endpoint.Port);
            return(Task.FromResult(this.wisejHost.Url));
        }
예제 #4
0
 protected override void OnStop()
 {
     this.host = null;
 }