[Vortex] About multiple async RPC call using same callback function

Francis Brosnan Blázquez francis at aspl.es
Sun Oct 9 08:56:19 CEST 2011


> Hello. All.

Hi Scott,

>     I am writing an online teaching application. 

Nice,

> The problem puzzle me now is in my application, each time an classroom
> is created, it needs to use rpc call to load data from server which
> returns a big structure. I am using C++. Now if I have 3 classrooms
> start up at same time. Each classroom will have its own rpc channel.
> And it will invoke rpc call from its own channel async. But when the
> result return, the callback function is same. I checked document,
> there is no way to know which channel this callback is for. How do I
> know from which channel I invoke the rpc call so I can find who invoke
> the rpc call?

You have several methods but depends on your design. For example, you
can use the following to "mark" each channel assigned to a room:

  vortex_channel_set_data (channel, "classroomid", PTR_TO_INT(1));

...then you can use the following to know which room it is:

  classroom_id = PTR_TO_INT (vortex_channel_get_data (channel, "classrommid"));

However, I don't like too much that method because it binds statically
channels to rooms. If you can, change your rpc payload content to
include the class room id, you can use any channel to query/operate over
any class room.

Cheers!

> Thanks.
> Regards.
> Scott
> _______________________________________________
> Vortex mailing list
> Vortex at lists.aspl.es
> http://lists.aspl.es/cgi-bin/mailman/listinfo/vortex
-- 
Francis Brosnan Blázquez <francis at aspl.es>
ASPL
91 134 14 22 - 91 134 14 45 - 91 116 07 57

AVISO LEGAL
 
En virtud de lo dispuesto en la Ley Orgánica 15/1999, de 13 de
diciembre, de Protección de Datos de Carácter Personal, le informamos de
que sus datos de carácter personal, recogidos de fuentes accesibles al
público o datos que usted nos ha facilitado previamente, proceden de
bases de datos propiedad de Advanced Software Production Line, S.L.
(ASPL).
 
ASPL garantiza que los datos serán tratados con la finalidad de mantener
las oportunas relaciones comerciales o promocionales con usted o la
entidad que usted representa. No obstante, usted puede ejercitar sus
derechos de acceso, rectificación, cancelación y oposición dispuestos en
la mencionada Ley Orgánica, notificándolo por escrito a ASPL -
Protección Datos, C/Antonio Suárez 10 A-102, 28802, Alcalá de Henares
(Madrid).






More information about the Vortex mailing list