Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions libraries/SocketWrapper/src/AClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ void arduino::AClient::setSocket(Socket *sock) {
client->setSocket(sock);
}

void arduino::AClient::setConnectionTimeout(unsigned long timeout) {
setSocketTimeout(timeout);
}


void arduino::AClient::setSocketTimeout(unsigned long timeout) {
if (!client) {
newMbedClient();
Expand Down
1 change: 1 addition & 0 deletions libraries/SocketWrapper/src/AClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class AClient : public Client {

using Print::write;

void setConnectionTimeout(unsigned long timeout);
void setSocketTimeout(unsigned long timeout);

protected:
Expand Down
2 changes: 1 addition & 1 deletion libraries/SocketWrapper/src/MbedClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ int arduino::MbedClient::connect(SocketAddress socketAddress) {
if (static_cast<TCPSocket *>(sock)->open(getNetwork()) != NSAPI_ERROR_OK) {
return 0;
}

sock->set_timeout(_timeout);
nsapi_error_t returnCode = static_cast<TCPSocket *>(sock)->connect(socketAddress);
int ret = 0;

Expand Down