Telnet "connection closed by foreign host"
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Telnet "connection closed by foreign host"
I'm getting this if I leave the WiPy at the REPL for any length of time. The WiPy is in the same room as the AP, 2-3 metres away. There are two other Linux systems using the AP, but both were idle while I was testing. Is there a timeout on the REPL standing idle?
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Telnet "connection closed by foreign host"
Is it after 5 minutes? That's what I'm seeing.
Andrew
Andrew
- danicampora
- Posts: 342
- Joined: Tue Sep 30, 2014 7:20 am
- Contact:
Re: Telnet "connection closed by foreign host"
Hi Peter,
Yes there's a 5 minute timeout by default (to prevent half closed sockets). You can increase this timeout easily:
The same function can also be used to get the current timeout...
Cheers,
Daniel
Yes there's a 5 minute timeout by default (to prevent half closed sockets). You can increase this timeout easily:
Code: Select all
import network
network.server_timeout(time_out_in_seconds) # min is 5 seconds, affects both telnet and FTP
Cheers,
Daniel
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Telnet "connection closed by foreign host"
Thanks
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Telnet "connection closed by foreign host"
Looks like network.server_timeout() disappeared with todays update.
Instead there is something like network.server.timeout(), but giving a number as argument just results in an error. Any update on the API doc?
Regards
Instead there is something like network.server.timeout(), but giving a number as argument just results in an error. Any update on the API doc?
Regards
- danicampora
- Posts: 342
- Joined: Tue Sep 30, 2014 7:20 am
- Contact:
Re: Telnet "connection closed by foreign host"
Docs will be generated later today, along with the official release. Do
Code: Select all
from network import server
server = server(timeout=value_in_seconds)
Re: Telnet "connection closed by foreign host"
Thank you very much for the fast reply. That works,