parallaxinc / PropLoader

Parallax Propeller loader supporting both serial and wifi downloads
MIT License
27 stars 13 forks source link

Explore timeout before "connect failed" #14

Closed PropGit closed 8 years ago

PropGit commented 8 years ago

I experienced a delay > 20 or 30 seconds before the connect failed message in the following results:

Loading 'LargeSpinCodePABWX.binary'
Loading second-stage loader
connect failed    <-- major delay before this message arrived
error: connect failed
error: set-baud-rate request failed
error: load failed: -1

Note: The module was having occasional loss of association near this time, which may account for the extra delay; however, if we could shorten the timeout to something more reasonable (thinking there's no possibility of recovery after a certain short period (seconds)), that would be wonderful.

dbetz commented 8 years ago

The connect() socket function doesn't seem to have a timeout parameter. I'll have to check to see how a timeout can be specified for it.

PropGit commented 8 years ago

Maybe there's no was to adjust this, and I can't tell if it's directly related to that either; just pointing out something that we may be able to optimize. If any part of the communication has reached a point of no return, significant additional delay before the user can try something else only leads to user frustration.

dbetz commented 8 years ago

Changed the connect timeout for HTTP requests to 2 seconds.