File tree 3 files changed +7
-1
lines changed
libraries/SocketWrapper/src
3 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,11 @@ void arduino::AClient::setSocket(Socket *sock) {
18
18
client->setSocket (sock);
19
19
}
20
20
21
+ void arduino::AClient::setConnectionTimeout (unsigned long timeout) {
22
+ setSocketTimeout (timeout);
23
+ }
24
+
25
+
21
26
void arduino::AClient::setSocketTimeout (unsigned long timeout) {
22
27
if (!client) {
23
28
newMbedClient ();
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ class AClient : public Client {
53
53
54
54
using Print::write;
55
55
56
+ void setConnectionTimeout (unsigned long timeout);
56
57
void setSocketTimeout (unsigned long timeout);
57
58
58
59
protected:
Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ int arduino::MbedClient::connect(SocketAddress socketAddress) {
100
100
if (static_cast <TCPSocket *>(sock)->open (getNetwork ()) != NSAPI_ERROR_OK) {
101
101
return 0 ;
102
102
}
103
-
103
+ sock-> set_timeout (_timeout);
104
104
nsapi_error_t returnCode = static_cast <TCPSocket *>(sock)->connect (socketAddress);
105
105
int ret = 0 ;
106
106
You can’t perform that action at this time.
0 commit comments