We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 936eaa5 + 74dd30b commit 05c7a86Copy full SHA for 05c7a86
tls-client/HelloHttpsClient.cpp
@@ -110,7 +110,11 @@ int HelloHttpsClient::run()
110
return ret;
111
112
/* Start a connection to the server */
113
- if ((ret = socket.connect(server_addr, server_port)) != NSAPI_ERROR_OK) {
+ SocketAddress saddr;
114
+ NetworkInterface *network = NetworkInterface::get_default_instance();
115
+ network->gethostbyname(server_addr, &saddr);
116
+ saddr.set_port(server_port);
117
+ if ((ret = socket.connect(saddr)) != NSAPI_ERROR_OK) {
118
mbedtls_printf("socket.connect() returned %d\n", ret);
119
120
}
0 commit comments