mirror of
https://github.com/open62541/open62541.git
synced 2026-10-17 04:42:09 +08:00
fix(server): start queued reverse connections after event loop startup
This commit is contained in:
committed by
Julius Pfrommer
parent
7765769e5a
commit
e0034851de
@@ -455,8 +455,10 @@ UA_Server_addReverseConnect(UA_Server *server, UA_String url,
|
||||
if(handle)
|
||||
*handle = newContext->handle;
|
||||
|
||||
/* Attempt to connect right away */
|
||||
res = attemptReverseConnect(rpm, newContext);
|
||||
/* The EventLoop's ConnectionManagers are started during server startup.
|
||||
* Until then, keep the reverse connection for the startup attempt. */
|
||||
if(rpm->drv.state == UA_LIFECYCLESTATE_STARTED)
|
||||
res = attemptReverseConnect(rpm, newContext);
|
||||
|
||||
unlockServer(server);
|
||||
return res;
|
||||
@@ -530,6 +532,13 @@ UA_ReverseBinaryProtocolManager_start(UA_Driver *drv) {
|
||||
/* Set the state to started */
|
||||
setReverseBinaryProtocolManagerState(rpm, UA_LIFECYCLESTATE_STARTED);
|
||||
|
||||
/* Start reverse connections that were registered before server startup. */
|
||||
reverse_connect_context *rev;
|
||||
LIST_FOREACH(rev, &rpm->reverseConnects, next) {
|
||||
if(!rev->connectionId)
|
||||
attemptReverseConnect(rpm, rev);
|
||||
}
|
||||
|
||||
return UA_STATUSCODE_GOOD;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user