how to get ip and port that server is bounded to

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

grhwood
Posts: 116
Joined: 15 Mar 2011, 04:43

how to get ip and port that server is bounded to

Postby grhwood » 22 Nov 2013, 19:37

Hi,

Is it possibile to get the ip and port that server is bounded to ?

Thanks,
User avatar
Lapo
Site Admin
Posts: 21690
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: how to get ip and port that server is bounded to

Postby Lapo » 23 Nov 2013, 09:59

You mean at runtime?
It's easier if you access the configuration of the server:

Code: Select all

import com.smartfoxserver.v2.config.*;
...
List<SocketAddress> = sfs.getConfigurator().getServerSettings().socketAddresses;

Each item in the list is one of the configured sockets with various details: address, port, type etc... you will see via IDE auto-completion. It's straightforward.

Hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: Google [Bot] and 41 guests