private void ImageChanged(CubeImage image)
 {
     SendImage(image);
 }
        private void SendImage(CubeImage image)
        {
            if ((DateTime.Now - _lastReceived).TotalMilliseconds < 250)
                return;

            if (_udpConfigPending)
            {
                SetupUdpClients();
                _udpConfigPending = false;
            }

            // send data
            byte[] dgram = image.ToPacket();

            foreach (IPEndPoint endpoint in _hosts)
            {
                var client = new TcpClient();

                client.Connect(endpoint);

                using (NetworkStream stream = client.GetStream())
                {
                    stream.Write(dgram, 0, dgram.Length);
                }

                client.Close();
            }

            /*
            foreach (TcpClient client in _clients)
            {

                using (NetworkStream stream = client.GetStream())
                {
                    stream.Write(dgram, 0, dgram.Length);
                }

                //client.Send(dgram, dgram.Length);
                //var receivedData = client.Receive(ref ep);
            }*/
        }