Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [milo-dev] UaTcpStatckClient.getEndpoints(link).get() not return a "real ip+port"

You can't force the server to return the real IP - you would have to correctly configure the servers for that to happen.

Instead of using the hosts file you can update the hostname and port in the endpoints yourself. Here's an older Stack Overflow post about it: https://stackoverflow.com/a/40555243/85927

There's also now a utility to help with updating the endpoints: https://github.com/eclipse/milo/blob/fa279228f4d7870f9315dd63963f248e2648261b/opc-ua-stack/stack-core/src/main/java/org/eclipse/milo/opcua/stack/core/util/EndpointUtil.java#L92-L136

On Tue, Jul 2, 2019 at 12:26 AM sunjj@xxxxxxxxxxxxxx <sunjj@xxxxxxxxxxxxxx> wrote:
Hello,

My milo version is 0.2.1。

Here is my code:
EndpointDescription[] endpoints = UaTcpStackClient.getEndpoints(link).get();
EndpointDescription endpoint = Arrays.stream(endpoints)
.filter(e -> e.getSecurityPolicyUri().equals(securityPolicy.getSecurityPolicyUri()))
.findFirst()
.orElseThrow(() -> new Exception("create client failed"));
Debug information:

I pass "link"(opc.tcp://192.168.88.210:53530) to get endpoints, But I get the Endpoints is "DESKTOP-VFA7NRS:53530"。

The opc server is running on windows, the opc client is running on linux. I add "DESKTOP-VFA7NRS"  to the /etc/hosts to solve the problem in the past. 

But now, I want to connect to  three opc servers,  the three servers all return same endpoints: "opc.tcp://otc:56000".

How can I get real endpont of "ip:port"?

Thank you!
jianjiao 


_______________________________________________
milo-dev mailing list
milo-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/milo-dev

Back to the top