[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [krita/langkamp/remotecontrol] plugins/extensions/remotecontrol: Use internal waiting on the network
From: Sven Langkamp <sven.langkamp () gmail ! com>
Date: 2016-07-26 11:37:42
Message-ID: E1bS0gA-0004BA-0p () code ! kde ! org
[Download RAW message or body]
Git commit e56ce0494ee29d5cfaa04a64236ebcbf76d9c78e by Sven Langkamp.
Committed on 26/07/2016 at 11:35.
Pushed by langkamp into branch 'langkamp/remotecontrol'.
Use internal waiting on the network layer
M +5 -17 plugins/extensions/remotecontrol/kis_opcua_server.cpp
http://commits.kde.org/krita/e56ce0494ee29d5cfaa04a64236ebcbf76d9c78e
diff --git a/plugins/extensions/remotecontrol/kis_opcua_server.cpp \
b/plugins/extensions/remotecontrol/kis_opcua_server.cpp index a7d3564..4f190a5 100644
--- a/plugins/extensions/remotecontrol/kis_opcua_server.cpp
+++ b/plugins/extensions/remotecontrol/kis_opcua_server.cpp
@@ -41,6 +41,7 @@ QString uaStringToQString(const UA_String& uaString)
static UA_StatusCode readVariable(void *handle, const UA_NodeId nodeid, UA_Boolean \
sourceTimeStamp,
const UA_NumericRange *range, UA_DataValue \
*dataValue) { +
dataValue->hasValue = true;
QString id = uaStringToQString(nodeid.identifier.string);
@@ -78,6 +79,7 @@ static UA_StatusCode readVariable(void *handle, const UA_NodeId \
nodeid, UA_Boole static UA_StatusCode writeVariable(void *handle, const UA_NodeId \
nodeid,
const UA_Variant *data, const UA_NumericRange \
*range) {
+
QString id = uaStringToQString(nodeid.identifier.string);
if(!m_variableMap.contains(id)){
@@ -167,23 +169,9 @@ void KisOpcUaServer::run()
objectIndex++;
}
- UA_Server_run_startup(server);
-// if(retval != UA_STATUSCODE_GOOD)
-// {
-// UA_Server_delete(server);
-// nl.deleteMembers(&nl);
-// return;
-// }
-
- while(running) {
- UA_UInt16 timeout = UA_Server_run_iterate(server, false);
-
- struct timeval tv;
- tv.tv_sec = 0;
- tv.tv_usec = timeout * 1000;
- select(0, NULL, NULL, NULL, &tv);
- }
- UA_Server_run_shutdown(server);
+ UA_StatusCode retval = UA_Server_run(server, &running);
+ UA_Server_delete(server);
+ nl.deleteMembers(&nl);
}
void KisOpcUaServer::addObject(QObject *object)
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic