what kind of handle should I return to client side from server side?

Login to reply to this topic.
Mon, 2007-10-08 09:13
Joined: 2004-12-07
Forum posts: 72

Hello,

I will create an dynamic object array in server side. I also need to operate those objects from the clide side. Therefore, I need to return the handle of each object. I hope to know what kind of handles will be the easiest way for me to control those objects from client side?

for example, the integer number assigned in the server side? or the reference of the object?

Thanks!


Tue, 2007-10-09 21:22
Joined: 2007-09-23
Forum posts: 159
Re: what kind of handle should I return to client side

Depends what you mean by operate. You can't pass a handle such as a pointer/reference to an object between client and server because they will be in different processes (in 99% of standard use). How do you want to control them?

Thu, 2007-10-11 07:14
Joined: 2004-12-07
Forum posts: 72
Re: what kind of handle should I return to client side from serv

I hope from the client side we can tell server which object can be used by handle. In this case, how can we generated handles? from client side or server side?

Thu, 2007-10-11 12:13
Joined: 2004-11-29
Forum posts: 1233
Re: what kind of handle should I return to client side from serv

Handles should be generated by whomever owns whatever resource the handle is associated with.
Noone else could generate them in a sensible way if you think about it.

How you generate handles is totally up to you, and doesn't really matter, as long as the owner of the resource can use it to find the object in a safe (and preferably efficient) way.

For your case, the integer index into the array sounds like a good choice.

  • Login to reply to this topic.