private void bServerSendOne_Click(object sender, EventArgs e) { ButtonClickData data = new ButtonClickData("Send to one client"); var ids = server.Clients; if (ids.Count == 0) { return; } Guid id = ids[0]; server.SendClient(data, id); }
private void serverDataHandler(BaseDataPackage data, Guid id) { ButtonClickData d = data.Unbox(); tbServerData.Text = d.ButtonClicked; }
private void clientDataHandler(BaseDataPackage data) { ButtonClickData d = data.Unbox(); tbClientData.Text = d.ButtonClicked; }
private void bServerSendAll_Click(object sender, EventArgs e) { ButtonClickData data = new ButtonClickData("Sent to all clients"); server.SendToAll(data); }
private void bClientSend_Click(object sender, EventArgs e) { ButtonClickData data = new ButtonClickData("Send data from client"); client.SendData(data); }