Kaynağa Gözat

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 5 yıl önce
ebeveyn
işleme
65367337c1
1 değiştirilmiş dosya ile 3 ekleme ve 1 silme
  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;