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
server socket address
Re: server socket address
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.
It's the main jysfs.jar.
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.
Re: server socket address
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
Re: server socket address
In SFS2X you can configure a number of socket listeners, this is the code to extract the list from the config:
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
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
Return to “Server Side Extension Development”
Who is online
Users browsing this forum: No registered users and 56 guests