[Twisted-Python] Telnet & echo
I try to find a solution on google, but nothing I have found there worked in my code. The situation is: I have a telnet client. When I am sending a command to a server my dataReceived loop gets a command I send and response. For example I send a "pwd" command, and in dataReceived i got: pwd /home/user/ I want to have only response. I try to send before sending command IAC WONT ECHO or send command "unset echo" but I have still a command and response in dataReceived. How to shutdown echo?
Hi Michal, Well, it depends. If the server has a command to disable echo, then you should ask the server mantainer. In the case of a client side way to "disable" echo, there's a simple way: just save the last sent command in a string, and then ignore it as input in the dataReceived event. It's quite ugly but worked for me. David Michał Tyde wrote:
I try to find a solution on google, but nothing I have found there worked in my code. The situation is: I have a telnet client. When I am sending a command to a server my dataReceived loop gets a command I send and response. For example I send a "pwd" command, and in dataReceived i got: pwd /home/user/ I want to have only response. I try to send before sending command IAC WONT ECHO or send command "unset echo" but I have still a command and response in dataReceived. How to shutdown echo?
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
On Aug 19, 2005, at 9:56 AM, Michał Tyde wrote:
I try to find a solution on google, but nothing I have found there worked in my code. The situation is: I have a telnet client. When I am sending a command to a server my dataReceived loop gets a command I send and response. For example I send a "pwd" command, and in dataReceived i got: pwd /home/user/ I want to have only response. I try to send before sending command IAC WONT ECHO or send command "unset echo" but I have still a command and response in dataReceived. How to shutdown echo?
You want to send IAC DONT ECHO, to which the server should respond IAC WONT ECHO. James
participants (3)
-
David Guaraglia
-
James Y Knight
-
Michał Tyde