Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added WiFiClient::setConnectTimeout #99

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DesktopMan
Copy link

Suggestion for connect timeout based on #73. No documentation yet, just looking for implementation feedback.

@@ -63,8 +63,7 @@ int WiFiClient::connect(IPAddress ip, uint16_t port) {

unsigned long start = millis();

// wait 4 second for the connection to close
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed these comments as they seem to be completely unrelated. (Copy paste accident from earlier?)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it may be used later on

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the comment was completely wrong. It was waiting to connect, not for the connection to close, and it waited 10 seconds not 4...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay

@DesktopMan DesktopMan changed the title Added WiFiClient::setConnectTimeout [do not merge] Added WiFiClient::setConnectTimeout Feb 22, 2020
@DesktopMan
Copy link
Author

Rebased for master. I didn't get any feedback so I'm asking if it can be merged now.

@fmatray
Copy link
Contributor

fmatray commented May 28, 2020

Hello,
I'm very interested in this feature for a project.
I'll test it this week.

@fmatray
Copy link
Contributor

fmatray commented May 28, 2020

I tried with a connexion IP:PORT without SSL. It work with with remote host up and, partially, when down.The call ServerDrv::startClient() seems to block for 8s, with remote host down.

My code test :

client->setConnectTimeout(1000);
Serial.println("Trying to connect");
now = millis();
connected = client->connect(IP, PORT);
Serial.print("End of try:");
Serial.println(millis() - now);

The Ethernet library have the same method but called setConnectionTimeout(). It would be nice to keep the same API.

I'm interested in this feature to make non blocking connexion.

@Alexander96f
Copy link

Hey are there any updates on this?
I have a similiar problem here: https://github.com/arduino-libraries/WiFiNINA/issues/144

@eugeniop
Copy link

eugeniop commented Dec 14, 2020

Would be great to have this option in the library. Any reason why not merging it? @thekunalsaini ?

@lasselukkari
Copy link

I believe these changes will not actually work because the timeout value is not passed to the nina-fm. It still waits there for the default time.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@hisprofile
Copy link

what happened to this beautiful addition

@JAndrassy
Copy link

what happened to this beautiful addition

it doesn't work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants