Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
UseLocalhost and Linux (SDK 1.5)
September 19, 2014
17:18, EEST
Avatar
Xavier
Member
Members
Forum Posts: 43
Member Since:
March 26, 2014
sp_UserOfflineSmall Offline

Hi,

I’ve noticied that using the Server SDK with the UseLocalhost and AddAllIPAddresses works perfectly fine on Windows but on Linux it requires that the /etc/hosts file contains the hostname and the IP Address to use. At least with a CentOS fresh install.

So for instance, if I want to be able to use the public IP of my server, I have to put the IP and hostname in the hostfile. This is of course not really good if you want to be able to change the IP of the server and do not remember to change the hosts file.

I just would like to know if there is a better behavior possible without changing the SDK (we are using the 1.4.8 version for this software). If possible, I would like to have a change impacting only the OS configuration or my software that configures the server sdk. For instance should I add all enpoints manually by finding myself the public IP of the computer + the loopback address (NetworkInterface.getNetworkInterfaces() ?)

I did no test yet with the 2.0 SDK but I believe you may have change the way this works now (I’ve seen that useLocalhost is deprecated for instance).

Thank you !

September 22, 2014
9:10, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1009
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Yes, that’s been problematic in Linux. And yes, you should be able to add endpoints to the server as necessary.

In 2.0 SDK, the EndpointUrl is no longer that strictly tied to the address the server is listening at. So there is the new property BindAddresses, in which you can define the interfaces used for communication and the EndpointUrl is generated automatically from the host name of the computer. The clients can still connect to the server using the IP Address, even though there is no separate endpoint for it. Therefore, you shouldn’t need to add custom endpoints either.

September 22, 2014
9:16, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1009
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

SDK 1.5 uses InetAddress.getAllByName(hostName) to get all the endpoints to add (if you have UseAllIpAddresses), whereas

SDK 2.0 uses the stack method EndpointUtil.getInetAddresses() to get the default list of BindAddresses – which is in fact using NetworkInterface.getNetworkInterfaces().

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
26 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

ibrahim: 75

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 685

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6259

Newest Members:

Jan-Pfizer, DavidROunc, fen.pang@woodside.com, aytule, rashadbrownrigg, christi10l, ahamad1, Flores Frederick, ellenmoss, harriettscherer

Moderators: Jouni Aro: 1009, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 321, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1