server socket address

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

ramana
Posts: 20
Joined: 16 Sep 2013, 14:47

server socket address

Postby ramana » 04 Mar 2015, 07:38

i want to know on which ip address server is running.
i found the code

import it.gotoandplay.smartfoxserver.config.ConfigData;

String ipAddr = ConfigData.SERVER_ADDR;
int port = ConfigData.SERVER_PORT;

My doubt is in which jar file this Class is available.


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

Re: server socket address

Postby Lapo » 04 Mar 2015, 10:18

Hi,
you have posted in the SmartFoxServer 2X question, but you're working with SmartFoxServer PRO, so I have moved your post.

ConfigData.SERVER_ADDR will return the address that is specified in the server's config.xml file.

My doubt is in which jar file this Class is available.

It's the main jysfs.jar.
Lapo
--
gotoAndPlay()
...addicted to flash games
ramana
Posts: 20
Joined: 16 Sep 2013, 14:47

Re: server socket address

Postby ramana » 04 Mar 2015, 11:23

Hi Lapo thank u for your reply. I am using smarrfox server 2X 2.7.1. in this only i want to get the socket address. please tell me the detailed process
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: server socket address

Postby Lapo » 04 Mar 2015, 14:50

In SFS2X you can configure a number of socket listeners, this is the code to extract the list from the config:

Code: Select all

List<SocketAddress> adresses = SmartFoxServer.getInstance().getConfigurator().getServerSettings().socketAddresses;

Then you can extract the firs element from the list if you are using only one socket, or more if you have configured more of them.

The import for SocketAddress is --> com.smartfoxserver.v2.config.ServerSettings.SocketAddress
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 18 guests