0
> retry = range(3) 
> for attempt in retry:
         try:
>            try:
>                tn = telnetlib.Telnet(HOST)
>            except exception  as e:
>                 log error
> 
>             firing cmd
>             break    
          except Exception as e: 
>               log error    
>         finally:
>               telnet close

Is the best way or how many times i can retry in telnet lib.best way need.

Python_Dude
  • 507
  • 6
  • 12
  • It isn't clear what question you are asking, and it is possible that you are asking the wrong question (see "[XY Problem](http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem)". Can you describe how and why you are getting "connection reset by peer" errors? – Robᵩ Jan 02 '14 at 20:21
  • TO solve telnet - connection reset by peer ERROR...I am trying to retry the connection 3 times...its right solution?? – Python_Dude Jan 07 '14 at 19:14

0 Answers0