hi^^.
I built a server as follows:
--------------------------------------------------------------------------------
client---load balancer --- real server 1 (smartfox 2x) ---- DB
\ /
\ /
real server 2 (smartfox 2x)
--------------------------------------------------------------------------------
if user1 is in real server 1 and user2 is in real server 2, user1 can recognize ? whether user2 is in online or not.?
is there any service provided by smartfox 2x?
thanks for answer.
When two servers.....
Re: When two servers.....
Hi,
out of the box no. But for example you have a database, so you can set a flag in your DB every time a user logs in and when they leave.
This way you can always know who's online and who isn't.
Hope it helps
out of the box no. But for example you have a database, so you can set a flag in your DB every time a user logs in and when they leave.
This way you can always know who's online and who isn't.
Hope it helps
Re: When two servers.....
Just curiously, what is your load balancer ?
Re: When two servers.....
thanks Lapo
I implemented a online recognition system
I have a another question!
if the both user 1 and user 2 are online,
these two users can exchange message in real time?
hi grhwood
I used ipvsadm on CentOS
I implemented a online recognition system
I have a another question!
if the both user 1 and user 2 are online,
these two users can exchange message in real time?
hi grhwood
I used ipvsadm on CentOS
Re: When two servers.....
In order to do that the two servers must be able to communicate.
This can be implemented in several ways, for example JMS (Java Message Service)or a library like Hazelcast
Personally I would probably choose the latter as it's quite easy to use for distributed events. It uses the same concept of "topics" like JMS and allows any node in the system to listen for any of those topics. You can check this example: http://www.hazelcast.com/docs/3.0/manua ... 02s04.html
It is pretty straightforward.
Back to your question, User Gonzo on Server1 can send a message to User Piggy on Server2 like this:
And viceversa. In other words Server1 will receive the message for Piggy. It will realize that Piggy is not a local User and will then send a notification to anyone else in the system by saying "Hey everybody, I have a message for Miss Piggy, please relay it to her". All Servers will receive the notification and the one with Piggy will pass the message to her.
Makes sense?
cheers
This can be implemented in several ways, for example JMS (Java Message Service)or a library like Hazelcast
Personally I would probably choose the latter as it's quite easy to use for distributed events. It uses the same concept of "topics" like JMS and allows any node in the system to listen for any of those topics. You can check this example: http://www.hazelcast.com/docs/3.0/manua ... 02s04.html
It is pretty straightforward.
Back to your question, User Gonzo on Server1 can send a message to User Piggy on Server2 like this:
Code: Select all
Gonzo ---> message ----> Server1 ----> (publish HazelCast topic) ----> Server 2 ----> Piggy
And viceversa. In other words Server1 will receive the message for Piggy. It will realize that Piggy is not a local User and will then send a notification to anyone else in the system by saying "Hey everybody, I have a message for Miss Piggy, please relay it to her". All Servers will receive the notification and the one with Piggy will pass the message to her.
Makes sense?
cheers
Re: When two servers.....
sorry...I don't understand T-T
Smartfox server 2x is installed in server computer 1 and 2.
Do I need to install another server? in server1 and server2 for hazelcast?
Can i implement a hazelcast in Extension class of Smartfox server?
I think that client have two connection. Smartfox and another connection for hazelcast. Is right?
Smartfox server 2x is installed in server computer 1 and 2.
Do I need to install another server? in server1 and server2 for hazelcast?
Can i implement a hazelcast in Extension class of Smartfox server?
I think that client have two connection. Smartfox and another connection for hazelcast. Is right?
Re: When two servers.....
Hi,
no Server1 and Server2 are your two servers with SFS installed on. You don't need more server machines.
Yes, exactly
Hazelcast uses peer-to-peer communication so it will automatically discover other instances in the same network. You just need to integrate it in your Extension, deploy the Extension on the two SmartFoxServer instances and they will be able to see each other and send events to one another.
Cheers
no Server1 and Server2 are your two servers with SFS installed on. You don't need more server machines.
Can i implement a hazelcast in Extension class of Smartfox server?
Yes, exactly
I think that client have two connection. Smartfox and another connection for hazelcast. Is right?
Hazelcast uses peer-to-peer communication so it will automatically discover other instances in the same network. You just need to integrate it in your Extension, deploy the Extension on the two SmartFoxServer instances and they will be able to see each other and send events to one another.
Cheers
Who is online
Users browsing this forum: Baidu [Spider] and 126 guests