File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,9 @@ void arduino::WiFiClient::getStatus() {
3131int arduino::WiFiClient::connect (SocketAddress socketAddress) {
3232 if (sock == NULL ) {
3333 sock = new TCPSocket ();
34- static_cast <TCPSocket*>(sock)->open (WiFi.getNetwork ());
34+ if (static_cast <TCPSocket*>(sock)->open (WiFi.getNetwork ()) != NSAPI_ERROR_OK){
35+ return 0 ;
36+ }
3537 }
3638 // sock->sigio(mbed::callback(this, &WiFiClient::getStatus));
3739 // sock->set_blocking(false);
@@ -54,7 +56,9 @@ int arduino::WiFiClient::connect(const char *host, uint16_t port) {
5456int arduino::WiFiClient::connectSSL (SocketAddress socketAddress){
5557 if (sock == NULL ) {
5658 sock = new TLSSocket ();
57- static_cast <TLSSocket*>(sock)->open (WiFi.getNetwork ());
59+ if (static_cast <TLSSocket*>(sock)->open (WiFi.getNetwork ()) != NSAPI_ERROR_OK){
60+ return 0 ;
61+ }
5862 }
5963 if (beforeConnect) {
6064 beforeConnect ();
You can’t perform that action at this time.
0 commit comments