Click here to Skip to main content
15,899,754 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
In order to develop an app remote desktop WP7, I started to with a desktop simple viewer and it works but the problem that not show all actions that I do in Server side, that's video in YouTube can show you my problem
http://www.youtube.com/watch?v=3q-FumfYsPQ&feature=youtu.be
I use socket connection and I decode and encode my data (images). this my code in WP7 client side
C#
void Conncet(string IP_Address) {

        client_socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
        SocketAsyncEventArgs socketEventArg = new SocketAsyncEventArgs()
        {
            RemoteEndPoint = new IPEndPoint(IPAddress.Parse(IP_Address), 4532)
        };
        socketEventArg.Completed += OnConncetCompleted;
        client_socket.ConnectAsync(socketEventArg);
    }
void StartReceiving()
        {
            byte[] response = new byte[131072];
            SocketAsyncEventArgs socketEventArg = new SocketAsyncEventArgs();
            socketEventArg.Completed += OnReceiveCompleted;
            socketEventArg.SetBuffer(response, 0, response.Length);
            client_socket.ReceiveAsync(socketEventArg);
        }

private void ViewReceivedImage(byte[] buffer) { try { MemoryStream ms = new MemoryStream(buffer); BitmapImage bi = new BitmapImage(); bi.SetSource(ms); MyImage.Source = bi; ms.Close(); } catch (Exception) { } finally { StartReceiving(); } }



this my code in Server side (PC) sending images
C#
void StartSending() { while (!stop)

            try
            {
                Image oldimage = scr.Get_Resized_Image(wToCompare, hToCompare, scr.GetDesktopBitmapBytes());
                //Thread.Sleep(1);
                Image newimage = scr.Get_Resized_Image(wToCompare, hToCompare, scr.GetDesktopBitmapBytes());

                byte[] buffer = scr.GetDesktop_ResizedBytes(wToSend, hToSend);

                float difference = scr.difference(newimage, oldimage);


                if (difference >= 1)
                {

                    SenderSocket.Send(buffer);
                }


            }
            catch (Exception) { }
    }


My question is how can I make the send and receive fast to show the PC screen in WP7 in +/- real time.
Posted
Comments
PrafullaVedante 24-Feb-12 5:25am    
Use Remotedesktop COM component in your program. Why are you developing whole thing at your own ?
juste_3al_faza 24-Feb-12 5:45am    
The RDP protocol not work with WP7

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900