Parcourir la source

adjusted the UDP read timeout (i.e. the time the Subscriber blocks the OPC UA Server execurtion to wait for incoming UDP PubSub messages) to 1us

thomas il y a 5 ans
Parent
commit
65367337c1
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  1. 3 1
      src/pubsub/ua_pubsub_reader.c

+ 3 - 1
src/pubsub/ua_pubsub_reader.c

@@ -287,7 +287,9 @@ void UA_ReaderGroup_subscribeCallback(UA_Server *server, UA_ReaderGroup *readerG
         return;
     }
 
-    connection->channel->receive(connection->channel, &buffer, NULL, 1000);
+    // TFR: changed the timeout from 1000 (1ms) to 1 (1us).
+    // TFR: blocking the OPC UA Server to wait for a UDP PubSub message reduces performance and should be avoided
+    connection->channel->receive(connection->channel, &buffer, NULL, 1);
     if(buffer.length > 0) {
         UA_LOG_INFO(&server->config.logger, UA_LOGCATEGORY_USERLAND, "Message received:");
         UA_NetworkMessage currentNetworkMessage;