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: 1026
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: 1026
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: 1919

Currently Online:
11 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: 738

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1524

Posts: 6451

Newest Members:

jonathonmcintyre, fannielima, kristiewinkle8, rust, christamcdowall, redaahern07571, nigelbdhmp, travistimmons, AnnelCib, dalenegettinger

Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1026, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0

Administrators: admin: 1