I'm writing a simple telnetclient but need some ideas in how to detect the login prompt? When connecting to the server it sends out some informations which ends with a new line so they I can handle but after the server sends the login prompt it stays and waits for input. So how do I detect that the server has sent something and is waiting for input?