Go Back   CodingForums.com > :: Client side development > Flash & ActionScript > Adobe Flex

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-12-2010, 05:58 AM   PM User | #1
nthaka1
New to the CF scene

 
Join Date: Feb 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
nthaka1 is an unknown quantity at this point
Cool Count Shared objects created on server

Hi Experts,

I am working on a game projects right now. I have created game using Flex and FluorineFx(ASP.NET). In this I have used persistent remote shared object to share the common UI to two players. Now It can be heavy traffic on the server as there might be thousands of games running at a time. So to balance the load on the server, I want to count the shared objects created on the servers. If shared objects on the server exeeds the max limit then I will switch the requests to create sharerd object on the other server.

So for this, how can I count the shared objects created on the server. Also can I chech that the shared object is created or not on the server, I mean is there any methos which returns any flag based on the checking that shared object of perticular ID is exist or not.

I would appreciate if I will get quick reply as it is quite urgent for me.

Thanks in advance.
nthaka1 is offline   Reply With Quote
Old 02-18-2010, 08:04 PM   PM User | #2
kev_az79
New to the CF scene

 
Join Date: Feb 2010
Location: phx
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
kev_az79 is an unknown quantity at this point
how do i make a post for my question

I don't see how I post my question
kev_az79 is offline   Reply With Quote
Old 03-01-2010, 06:38 AM   PM User | #3
zhangweiit
New to the CF scene

 
Join Date: Sep 2007
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
zhangweiit is an unknown quantity at this point
i would do it like this:
on serverside , declare a class named ShareObject
it has a static member object table of type Dictionary
if u want to check if it is created ,define a id member
when the constructor is invoked ,count increase by one;


if u want shareobject to transfer between server and client
u'd better define serialize and unserialize methods
then transfer the share objects as string
and unserialize them from string

give u some code:
class ShareObject{
static Dictionary<int,ShareObject> objectTable;
int id;
public ShareObject(string data){
//if data is null,build a new one ,assign an id,and add to dictionary
//else,find id in data,check existence,and unserialize it;
}

string serialize(){...}
void unserialize(string data){...}

static int count(){...}
static bool existed(id){...}
static void add(int id,ShareObject obj){...};
static void remove(int id){...}
}

it's too simple,but just

Last edited by zhangweiit; 03-01-2010 at 06:58 AM.. Reason: edit code
zhangweiit is offline   Reply With Quote
Old 03-04-2010, 10:49 AM   PM User | #4
nthaka1
New to the CF scene

 
Join Date: Feb 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
nthaka1 is an unknown quantity at this point
Hi zhangweiit,

Thanks a lot. I will implement this approach and will let you know if any problem I have.
nthaka1 is offline   Reply With Quote
Reply

Bookmarks

Tags
flex, shared object

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:45 AM.


Advertisement
Log in to turn off these ads.