Beispiel #1
0
 private void StopHttpButton_Click(object sender, RoutedEventArgs e)
 {
     if (!(sender is Button button))
     {
         return;
     }
     button.IsEnabled = false;
     HttpServer.Stop();
     ListBoxServerMsg.Items.Insert(0, "Http服务关闭成功:" + DateTime.Now.ToString());
     StartHttpButton.IsEnabled = true;
 }
Beispiel #2
0
        private void StopButton_Click(object sender, RoutedEventArgs e)
        {
            Button button = sender as Button;

            if (button == null)
            {
                return;
            }
            button.IsEnabled = false;
            httpserver.Stop();
            ListBoxServerMsg.Items.Insert(0, "服务关闭成功:" + DateTime.Now.ToString());
            StartButton.IsEnabled = true;
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            HproseTcpListenerServer tcpserver = new HproseTcpListenerServer("tcp4://127.0.0.1:4321/");

            tcpserver.Add("Hello", typeof(Program));
            tcpserver.Start();
            HproseHttpListenerServer httpserver = new HproseHttpListenerServer("http://localhost:8888/");

            httpserver.Add("Hello", typeof(Program));
            httpserver.Start();
            Console.ReadKey();
            tcpserver.Stop();
            httpserver.Stop();
        }