Hi
how to get the server ip and port in room extension?
How to get server ip on server side
Re: How to get server ip on server side
It depends, what you need is the private IP address.
By default SFS2X 2.9 and higher bind the 0.0.0.0 address, which means "bind whatever is available".
With that setup you won't know exactly which address is the private one because your server may have more network interfaces... or it may not
If you bind the address manually from the AdminTool you could then read the address and port from runtime:
cheers
By default SFS2X 2.9 and higher bind the 0.0.0.0 address, which means "bind whatever is available".
With that setup you won't know exactly which address is the private one because your server may have more network interfaces... or it may not
If you bind the address manually from the AdminTool you could then read the address and port from runtime:
Code: Select all
List<SocketAddress> addresses = SmartFoxServer.getConfigurator().getServerSettings().socketAddresses;
SocketAddress addr = addresses.get(0);
cheers
Who is online
Users browsing this forum: No registered users and 127 guests