c# - Double enter press for reading data socket -


I am using this code (with minimal telnet) to do a telnet session with a sample server, Problems I have to press twice to read / send the output from the server, how is this possible? Do I have to use some async reading systems? "Telnet Connection Connection" New Telnet Connection ("Gobelizan", 23);

  // Create a new Telnet connection for the hostname "Gobelization" on "23"; Login with "user root", password "rootpassword", 100 mms, time of time, and to show the output string of the server = "" tc.login ("root", "rootpassword", 100); Console.Write (s); // server output "$" or "&"; Should end with, otherwise connection fail string signal = s.TrimEnd (); Quick = s.Substring (Speedy Lange 1 -1); If (prompt! = "$" & Amp; sign! = "& Gt;") Throw new exceptions ("Connection failed"); Soon = ""; // When connecting (TC. IC connected and prompt. Rim ()! = "Exit") // // display server output console Write (tc.Read ()); // Send client input to prompt server = console.readlines (); Tc.WriteLine (expedited); // Display Server Output Console Write (tc.Read ()); } Console. WrightLine ("Rejected"); Console.ReadLine ();  


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -