Beispiel #1
0
 private void Button3_Click(object sender, EventArgs e)
 {
     PipeServer.PipeServerStop();
     textBox2.AppendText("<< Pipe server stopped." + PipeUtils.sLineBreak);
     connected = false;
     SetButtons();
 }
Beispiel #2
0
        public static void Main(string[] args)
        {
            var pipeServer = new PipeServer <MyService, IMyService>();

            pipeServer.Start();
            Console.WriteLine("Server started...");
            Console.ReadLine();
            pipeServer.Stop();
            Console.WriteLine("Server stopped!");
            Console.ReadLine();
        }
Beispiel #3
0
 private void Form1_Load(object sender, EventArgs e)
 {
     SetButtons();
     PipeServer.PipeServerInitialize();
     // Register our method delegates as callbacks
     PipeServer.RegisterOnConnectCallback(OnConnect);
     PipeServer.RegisterOnDisconnectCallback(OnDisconnect);
     PipeServer.RegisterOnErrorCallback(OnError);
     PipeServer.RegisterOnMessageCallback(OnMessage);
     PipeServer.RegisterOnSentCallback(OnSent);
 }
Beispiel #4
0
        private void Button1_Click(object sender, EventArgs e)
        {
            if (PipeServer.PipeServerBroadcast(textBox1.Text))
            {
                textBox2.AppendText(string.Format("<< Successfully broadcasted message: {0}", textBox1.Text) + PipeUtils.sLineBreak);
            }
            else
            {
                textBox2.AppendText(string.Format("<< Failed to broadcast message: {0}", textBox1.Text) + PipeUtils.sLineBreak);
            }

            textBox1.Text = string.Empty;
        }
Beispiel #5
0
        private void Button2_Click(object sender, EventArgs e)
        {
            connected = PipeServer.PipeServerStart();

            if (connected)
            {
                textBox2.AppendText("<< Pipe server started." + PipeUtils.sLineBreak);
            }
            else
            {
                textBox2.AppendText("<< Unable to start the pipe server." + PipeUtils.sLineBreak);
            }

            SetButtons();
        }
Beispiel #6
0
 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     PipeServer.PipeServerDestroy();
 }