Change the IP server IP address

161 views
Skip to first unread message

Pablo Ugarte

unread,
Jun 20, 2022, 11:13:28 AM6/20/22
to open62541
I want to change the IP address of my server on Debian,  but I can't find the UA_ServerConfig_setCustomHostname()  replacement.

Could you help me?
Thanks!

Julius Pfrommer

unread,
Jun 21, 2022, 1:53:12 AM6/21/22
to open62541

Pablo Ugarte

unread,
Jun 21, 2022, 5:33:37 AM6/21/22
to open62541
Hello Julius,
Thanks for your answer, unluckily it din't work for me.
Can you look at my code ? Im trying to parametrize the IP adress via arguments.

Thank you for your help!
IP_Problem.png

Julius Pfrommer

unread,
Jun 24, 2022, 9:39:33 AM6/24/22
to open62541
That looks good. What do you use for argv[1]?
It should have the format opc.tcp://<hostname>:<port>.

Regards

Boushra Jaber

unread,
Mar 12, 2023, 7:32:26 PM3/12/23
to open62541
did you find a solution?

Giuseppe De Vito

unread,
Mar 27, 2024, 8:06:22 AMMar 27
to open62541
int main(int argc, char ** argv){
UA_String urls[1];
UA_Server *server = UA_Server_new();
UA_ServerConfig *uaServerConfig = UA_Server_getConfig(server);
signal(SIGPIPE , sigPipeHandler);

if(argc > 1){//set the hostname
urls[0] = UA_STRING(argv[1]);
uaServerConfig->serverUrls = urls;
uaServerConfig->serverUrlsSize = 1;
}
....
}
Reply all
Reply to author
Forward
0 new messages