Problems with read_eager and Telnet

kenansharon at gmail.com kenansharon at gmail.com
Thu Nov 3 09:10:49 EDT 2016


On Monday, 28 February 2011 10:54:56 UTC-5, Robi  wrote:
> Hi everybody,
>  I'm totally new to Python but well motivated :-)
> 
> I'm fooling around with Python in order to interface with FlightGear
> using a telnet connection.
> 
> I can do what I had in mind (send some commands and read output from
> Flightgear using the telnetlib) with a read_until() object to catch
> every output line I need, but it proved to be very slow (it takes 1/10
> of a sec for every read_until().
> 
> I tried using the read_eager() object and it's waaaayyyy faster (it
> does the job in 1/100 of a sec, maybe more, I didn't tested) but it
> gives me problems, it gets back strange strings, repeated ones,
> partially broken ones, well ... I don't know what's going on with it.
> 
> You see, I don't know telnet (the protocol) very good, I'm very new to
> Python and Python's docs are not very specific about that read_eager(9
> stuff.
> 
> Could someone point me to some more documentation about that? or at
> least help me in getting a correct idea of what's going on with
> read_eager()?
> 
> I'm going on investigating but a help from here would be very
> appreciated :-)
> 
> Thanks in advance,
>    Roberto

Say a can someone explain for me how read_eager and read _very_eager decide when to stop reading date from a socket?

If the command sent causes the server to reply with multiple lines how do the Python functions decide when to stop accepting new data from the socket?



More information about the Python-list mailing list