Flush() public method

Clears all buffers for this stream and causes any buffered data to be written to the underlying device.
An I/O error occurs.
public Flush ( ) : void
return void
Example #1
-2
        static void Main(string[] args)
        {
            client = new SshClient("130.18.14.67", "", "");
            client.Connect();
            stream = client.CreateShellStream(@"xterm", 80, 24, 800, 600, 2048);
            string cmd = "";

            //flush buffer
           stream.Flush();
           while(true)
           {
               stream.DataReceived += StartAsyncRead;
               Console.WriteLine("Logged in success!: ");
               cmd = Console.ReadLine();
               stream.WriteLine(cmd);
           }

           
        }