Browse Source

select check error

StalderT 6 years ago
parent
commit
d86f981317
1 changed files with 6 additions and 0 deletions
  1. 6 0
      plugins/ua_network_tcp.c

+ 6 - 0
plugins/ua_network_tcp.c

@@ -194,6 +194,12 @@ connection_recv(UA_Connection *connection, UA_ByteString *response,
         /* No result */
         if(resultsize == 0)
             return UA_STATUSCODE_GOODNONCRITICALTIMEOUT;
+
+        /* Error occurred */
+        if (resultsize == -1) {
+            connection->close(connection);
+            return UA_STATUSCODE_BADCONNECTIONCLOSED;
+        }
     }
 
     response->data = (UA_Byte*)