kevinherron / stack-bench

Simple OPC UA stack benchmarking tool
4 stars 2 forks source link

Each connection establishment will be done at localhost #2

Open mlang-de opened 7 years ago

mlang-de commented 7 years ago

Regardlessly which address is entered into the config file (e.g. "opc.tcp://10.11.5.8:51210/UA/Server"), the client will connect to "opc.tcp://localhost:51210/UA/Server". This is caused by function "getOpcUaClient(endpointUrl: String)". Variable 'endpointUrl' contains the correct string from the config file, after UaTcpStackClient.getEndpoints(endpointUrl).get() the IP address in variable 'endpoints' will be replaced and the client tries to connect to the localhost.

If the server certificate is modified with the current fix IP address the stack-bench tool will work.

kevinherron commented 7 years ago

Is the server returning endpoints that contain localhost in the endpoint URL rather than the IP address?

kevinherron commented 7 years ago

If so, this is a common question I've covered here: http://stackoverflow.com/questions/40554198/java-opc-ua-client-eclipse-milo-endpoint-url-changes-to-localhost/40555243#40555243

In this case though, you don't actually want to fix anything. The stack-bench tool should only be run on localhost.

mlang-de commented 7 years ago

You are right! I use the OPC Foundation Sample Server and check the GetEndpointsResponse with wireshark. The received EndpointUrl is 'opc.tcp://localhost:51210/UA/SampleServer'.

One other (dirty?) way to connect with the remote server could be to modify the config.xml from the OPCF sample server. / original /

opc.tcp://localhost:61210/UA/SampleClient /* modification for IP: 192.168.254.160 */ opc.tcp://192.168.254.160:61210/UA/SampleClient ------------------------------------------ "The stack-bench tool should only be run on localhost." Why this? Are there some technical reasons?
kevinherron commented 7 years ago

If you don't run on localhost I suspect most servers will show the same performance numbers as you're limited by the latency of the network connection.