Example #1
0
        void server_MessageReceivedEvent(SecureTcp.Secure_Stream client, SecureTcp.Tcp_Message ms)
        {
            switch(ms.Type)
            {
                case ((int)Desktop_Sharing_Shared.Message_Types.UPDATE_REGION):
                    {
                        var r = new Rectangle();
                        r.Y = BitConverter.ToInt32(ms.Blocks[1], 0);
                        r.X = BitConverter.ToInt32(ms.Blocks[2], 0);
                        r.Height = BitConverter.ToInt32(ms.Blocks[3], 0);
                        r.Width = BitConverter.ToInt32(ms.Blocks[4], 0);

                        UpdateImageEvent(r, ms.Blocks[5]);
                        break;
                    }
                case ((int)Desktop_Sharing_Shared.Message_Types.RESOLUTION_CHANGE):
                    {
                        NewImageEvent(new Point(BitConverter.ToInt32(ms.Blocks[2], 0), BitConverter.ToInt32(ms.Blocks[1], 0)),ms.Blocks[3]);
                        break;
                    }
                case ((int)Desktop_Sharing_Shared.Message_Types.MOUSE_IMAGE_EVENT):
                    {
                        MouseImageChangedEvent(new Point(BitConverter.ToInt32(ms.Blocks[2], 0), BitConverter.ToInt32(ms.Blocks[1], 0)), ms.Blocks[3]);
                        break;
                    }
                case ((int)Desktop_Sharing_Shared.Message_Types.MOUSE_POSITION_EVENT):
                    {
                        MousePositionChangedEvent(new Point(BitConverter.ToInt32(ms.Blocks[2], 0), BitConverter.ToInt32(ms.Blocks[1], 0)));
                        break;
                    }
                default:
                    break;
            }
        }
Example #2
0
 private void SendPass(SecureTcp.Secure_Stream client)
 {
     lock(_OutGoingMessagesLock)
     {
         foreach(var item in _OutGoingMessages)
         {
             client.Encrypt_And_Send(item);
         }
         _OutGoingMessages.Clear();
     }
     lock(_OutGoingFilesLock)
     {
         foreach(var item in _OutGoingFiles)
         {
             AddFileOrDirectory("", item);
         }
         _OutGoingFiles.Clear();
     }
 }