private void Button3_Click(object sender, EventArgs e) { PipeServer.PipeServerStop(); textBox2.AppendText("<< Pipe server stopped." + PipeUtils.sLineBreak); connected = false; SetButtons(); }
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(); }
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); }
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; }
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(); }
private void Form1_FormClosing(object sender, FormClosingEventArgs e) { PipeServer.PipeServerDestroy(); }