Beispiel #1
0
        /// <summary>
        ///     Writes the server's Initialization message, specifically the Framebuffer's properties.
        /// </summary>
        /// <param name="fb">The framebuffer that is sent.</param>
        public void WriteServerInit(Framebuffer fb)
        {
            try
            {
                writer.Write(Convert.ToUInt16(fb.Width));
                writer.Write(Convert.ToUInt16(fb.Height));
                writer.Write(fb.ToPixelFormat());

                writer.Write(Convert.ToUInt32(fb.DesktopName.Length));
                writer.Write(GetBytes(fb.DesktopName));
                writer.Flush();
            }
            catch (IOException ex)
            {
                Console.WriteLine(ex.Message);
                Close();
            }
        }
Beispiel #2
0
        /// <summary>
        /// Writes the server's Initialization message, specifically the Framebuffer's properties.
        /// </summary>
        /// <param name="fb">The framebuffer that is sent.</param>
        public void WriteServerInit(Framebuffer fb)
        {
            try
            {
                writer.Write(Convert.ToUInt16(fb.Width));
                writer.Write(Convert.ToUInt16(fb.Height));
                writer.Write(fb.ToPixelFormat());

                string desktopName = fb.DesktopName ?? Environment.MachineName; // = "admin";
                writer.Write(Convert.ToUInt32(desktopName.Length));
                writer.Write(GetBytes(desktopName));
                writer.Flush();
            }
            catch (IOException ex)
            {
                this.Server.LastError = ex;

                Console.WriteLine("WriteServerInit failed");
                Console.WriteLine(ex.Message);
                Close();
            }
        }
Beispiel #3
0
        /// <summary>
        /// Writes the server's Initialization message, specifically the Framebuffer's properties.
        /// </summary>
        /// <param name="fb">The framebuffer that is sent.</param>
        public void WriteServerInit(Framebuffer fb)
        {
            try
            {
                writer.Write(Convert.ToUInt16(fb.Width));
                writer.Write(Convert.ToUInt16(fb.Height));
                writer.Write(fb.ToPixelFormat());

                writer.Write(Convert.ToUInt32(fb.DesktopName.Length));
                writer.Write(GetBytes(fb.DesktopName));
                writer.Flush();
            }
            catch (IOException ex)
            {
                Console.WriteLine(ex.Message);
                Close();

            }
        }