20:25, EEST
June 27, 2012
I’ve been running the sample server on the same machine as the client, and now I’m moving it to a different machine.
The old machine was Win7, and the new machine is Debian. This line should bind the server to all network adapters, correct?
// Add the IP address(es) of the server host to the endpoints
server.setUseAllIpAddresses(true);
When I run on the Windows machine, I see lines like this in the log for each network adapter:
09/10/2012 16:08:33.060 INFO Server endpoint bound to opc.tcp://192.168.8.141:52520/OPCUA/TimsServer
09/10/2012 16:08:33.061 INFO Discovery endpoint bound to opc.tcp://192.168.8.141:52520
When I run on the Linux machine, I only see bindings for localhost, storm(the machine name), and 127.0.0.1.
I don’t get a line for the actual IP, which is 192.168.1.50. Here’s the output of netstat:
root@storm:/opc/server# netstat -lptu
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 localhost:52520 *:* LISTEN 8693/java
It looks like I can only connect from localhost. Am I doing something wrong?
Is there something I need to do to force the server to bind to the external IP address?
7:23, EEST
December 21, 2011
There seem to be differences in the Java network/socket implementation in different environments and JDKs.
However, it does not really matter that much any more(*) which endpoint URLs the server is bound to, since the clients will need to be able to pick up a useful endpoint anyway. So as long as your client can connect to the server port, it should be able to use any of the endpoints that are available, for example, the one bound to the host name.
See also http://www.prosysopc.com/blog/…..t-machine/, which was a bit similar issue.
(*) The first implementation of the Java CLient side required that there must be an exactly same endpointUrl defined in the server to which the client was connecting to. Since this will prevent connecting to server behind NAT addresses this has been changed to be less restrictive. The client will check the server certificate instead, to ensure that it is not connecting to a “fake server”. Still, you will see a warning in the client side log, if the endpointUrl is different to what is used for connecting.
8:33, EEST
September 5, 2012
Jouni Aro said
There seem to be differences in the Java network/socket implementation in different environments and JDKs.
However, it does not really matter that much any more(*) which endpoint URLs the server is bound to, since the clients will need to be able to pick up a useful endpoint anyway. So as long as your client can connect to the server port, it should be able to use any of the endpoints that are available, for example, the one bound to the host name.
See also http://www.prosysopc.com/blog/…..t-machine/, which was a bit similar issue.
@TimK: I got the same problem and get it around by replacing the linux machine hostname in /etc/hostname with the current IP@ of the bound IP interface.
check with hostname -f and check the INFO messages from log4j you should see the endpoints bindings with the locahost one (if activated on the server side by server.getSetUseLocalhost(true) and the “IP” one as for your Windows log.
yet , I think this is not the “proper” way of doing … 😉
seems like the resolv and etc/hosts are not checked … (?)
Eric
12:43, EEST
June 27, 2012
Most Users Ever Online: 1919
Currently Online:
19 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 88
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 744
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1529
Posts: 6471
Newest Members:
guadalupechastai, joleenbunnell, WilliamViego, edwardobeckenbau, Charlesslota, hilda21x1388, bertZok, Bernardclila, doylenewbery, mickey21654Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0
Administrators: admin: 1