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

SocketWrapper lib Client setConnectionTimeout added #915

Closed
wants to merge 1 commit into from

Conversation

JAndrassy
Copy link
Contributor

@JAndrassy JAndrassy commented Jul 1, 2024

In #769 I wrote in a comment

it is not a connection timeout as setConnectionTimeout should do! it is timeout on other operations, not on connect.

reading the Mbed TCPSocket.cpp source, I see that this is not true and Mbed uses that timeout in connect. Sorry. My mistake was my assumption that it works the same way as in LwIP, but Mbed adds some logic as it wraps LwIP.

this PR adds setConnectionTimeout as alias to setSocketTimeout and sets the timeout before connect

this timeout is now applied in MbedClient in connect, stop and write. read shouldn't block in Arduino API so in read the timeout is not used.

@JAndrassy JAndrassy force-pushed the mbedclient_conn_timeout branch from cabeaf8 to f0cb2a6 Compare July 1, 2024 06:51
@JAndrassy JAndrassy marked this pull request as draft July 1, 2024 16:38
@JAndrassy
Copy link
Contributor Author

JAndrassy commented Jul 1, 2024

closing, because the connect timeout is 30 seconds in lwIP and what Mbed's TCPSocket tries in its connect doesn't do anything in case of lwIP as net stack.
so my comment half year ago was in the end right.

@JAndrassy JAndrassy closed this Jul 1, 2024
@JAndrassy JAndrassy deleted the mbedclient_conn_timeout branch July 3, 2024 18:27
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.

1 participant