ARMmbed / mbed-client-classic

DEPRECATED: mbed Client adaptation layer for mbed OS Classic
https://cloud.mbed.com/docs/current
Apache License 2.0
0 stars 5 forks source link

m2mconnectionhandlerpimpl: retry TCP connect instead of using select #75

Closed TeroJaasko closed 6 years ago

TeroJaasko commented 7 years ago

The pal_connect() may now issue only one callback, which will cause a deadlock as the logic relied on previous behavior of getting at least one event after connect() to be able to use select() for detecting if connect was completed. Change logic to bravely retry pal_connect() after any event around connect sequence.

Note: this is not complete as it has a race condition on state variable and it is tested only on Linux so far.