Integrate

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

Moderators: Lapo, Bax

User avatar
hoangdoanh
Posts: 253
Joined: 21 Jun 2013, 04:54
Location: Vietnam

Integrate

Postby hoangdoanh » 29 Dec 2016, 06:51

Hi

Having a look at location of admin page, I see it locates inside folder : SmartFoxServer_2X/SFS2X/www/root/admin

I also want to use jetty on this location to store my 1 http service(static). How can I make this static http service interact with SmartFoxServer ?

Thank you

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

Re: Integrate

Postby Lapo » 29 Dec 2016, 10:37

Hi,
I am not sure what you mean by "static" service.

In order to interact with SmartFoxServer you need to deploy a java servlet which in turn can call SmartFoxServer code by accessing the main SmartFoxServer class.

For example:

Code: Select all

SmartFoxServer sfs = SmartFoxServer.getInstance();
ISFSApi api = sfs.getApiManager().getSFSApi();

api.createRoom(...);


Here's an article that will help:
http://smartfoxserver.com/blog/http-req ... tegration/

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
hoangdoanh
Posts: 253
Joined: 21 Jun 2013, 04:54
Location: Vietnam

Re: Integrate

Postby hoangdoanh » 04 Jan 2017, 02:48

Thanks Lapo

I am reading and applying it now , I am glad knowing this feature of SmartFoxServer

Cheers,
User avatar
hoangdoanh
Posts: 253
Joined: 21 Jun 2013, 04:54
Location: Vietnam

Re: Integrate

Postby hoangdoanh » 04 Jan 2017, 09:20

I have done it,

Thank you very much, that kind of integration is great. Never thought about that before.

That kind of integration can be implemented because jetty classes and SmartFoxServer classes are loaded by 1 class loader, can't it ?

I met some troubles with asm library version that causes scanning annotation. But it is okay now.

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

Re: Integrate

Postby Lapo » 04 Jan 2017, 09:31

hoangdoanh wrote:I have done it,
Thank you very much, that kind of integration is great. Never thought about that before.

That kind of integration can be implemented because jetty classes and SmartFoxServer classes are loaded by 1 class loader, can't it ?

Yes, they run in the same JVM and share the same top class loader.
(Although Extensions don't)

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 110 guests