示例#1
0
        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);
        }
示例#2
0
        private void serverDataHandler(BaseDataPackage data, Guid id)
        {
            ButtonClickData d = data.Unbox();

            tbServerData.Text = d.ButtonClicked;
        }
示例#3
0
        private void clientDataHandler(BaseDataPackage data)
        {
            ButtonClickData d = data.Unbox();

            tbClientData.Text = d.ButtonClicked;
        }
示例#4
0
        private void bServerSendAll_Click(object sender, EventArgs e)
        {
            ButtonClickData data = new ButtonClickData("Sent to all clients");

            server.SendToAll(data);
        }
示例#5
0
        private void bClientSend_Click(object sender, EventArgs e)
        {
            ButtonClickData data = new ButtonClickData("Send data from client");

            client.SendData(data);
        }