|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
How can I find the Flex client id?
by Martin Wickman
::
Rate this Message:
Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message Howdy
I've been struggling/sweating for quite some time now how I can get to the name/id that was used when the client connected to FluorineFx through Flex's mx:Consumer object (amf messaging polling). For example, I want to find the "charlie" used in: consumer.subscribe("charlie"); I've tried FluorineContext.Current.Client.Id and other permutations of that, but it only gives me the internal Fluorine id (hex-string like 43bcdec1a9...), not "charlie". Reading lots of Fluorine code led me frustratingly to some abomination like (((MessageDestination)msgBroker.GetDestination(DESTINATION_ID))).SubscriptionManager.GetSubscribers(asyncMsg); which works, except that it won't compile because MessageDestination is internal. Also, by debugging the message in the Flex client, I see that it in fact contains a clientId property (and a weird header called 'DSDstClientId') which contains the real thing. So apparently it is there somewhere, but where? So please, if possible, shed some light on this. Thanks! (The full story is that I'm implementation a simple locking scheme for my Flex clients and I need to send back the userid to all clients telling who's locking the object at the moment, so each client must know if they are holding the lock or not by comparing their own userid (ie "charlie") to the userid returned in my "object_is_locked_by: 43bcdec1a9..." message) /Martin _______________________________________________ fluorine mailing list fluorine@... http://fluorine.thesilentgroup.com/mailman/listinfo/fluorine_fluorine.thesilentgroup.com |
|
|
Re: How can I find the Flex client id?
by Support-179
::
Rate this Message:
Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message Hi Martin,
FluorineContext.Current.Client.Id is the Flex Client identity (the SWF's identity) that is assigned by the server (and then accessible from the SWF). http://livedocs.adobe.com/livecycle/8.2/programLC/common/langref/mx/messagin g/FlexClient.html mx:Consumer/Producer objects are Message Agents and have their own identity ("charlie" in your example or automatically assigned one if not specified). So your "charlie" id is identifying the message agent and NOT the flex client. The Fluorine context does not currently expose the current message agent identity (if there is any). If your .NET code is running in a custom messaging adapter's Invoke method then the agent identity is the clientId field of the IMessage interface. The weird DSDstClientId is the so called DESTINATION_CLIENT_ID_HEADER set by the server :) "Messages pushed from the server may arrive in a batch, with messages in the batch potentially targeted to different Consumer instances. Each message will contain this header identifying the Consumer instance that will receive the message." Now the question is if you are interested in the Flex Client identity or a specific Message Agent identity? Zoli PS: in v1.0.0.17 you will have access through the FluorineContext.Current.Client (IClient) to the connected IMessageClient(s), IMessageClient being a server representation of a client-side Flex Message Agent. I already started to commit the v1.0.0.17 source code to the SVN however be careful taking it as there are some breaking changes in the API I have to write about... -----Original Message----- From: fluorine-bounces@... [mailto:fluorine-bounces@...] On Behalf Of Martin Wickman Sent: Friday, April 17, 2009 6:45 PM To: fluorine@... Subject: [Fluorine] How can I find the Flex client id? Howdy I've been struggling/sweating for quite some time now how I can get to the name/id that was used when the client connected to FluorineFx through Flex's mx:Consumer object (amf messaging polling). For example, I want to find the "charlie" used in: consumer.subscribe("charlie"); I've tried FluorineContext.Current.Client.Id and other permutations of that, but it only gives me the internal Fluorine id (hex-string like 43bcdec1a9...), not "charlie". Reading lots of Fluorine code led me frustratingly to some abomination like (((MessageDestination)msgBroker.GetDestination(DESTINATION_ID))).Subscriptio nManager.GetSubscribers(asyncMsg); which works, except that it won't compile because MessageDestination is internal. Also, by debugging the message in the Flex client, I see that it in fact contains a clientId property (and a weird header called 'DSDstClientId') which contains the real thing. So apparently it is there somewhere, but where? So please, if possible, shed some light on this. Thanks! (The full story is that I'm implementation a simple locking scheme for my Flex clients and I need to send back the userid to all clients telling who's locking the object at the moment, so each client must know if they are holding the lock or not by comparing their own userid (ie "charlie") to the userid returned in my "object_is_locked_by: 43bcdec1a9..." message) /Martin _______________________________________________ fluorine mailing list fluorine@... http://fluorine.thesilentgroup.com/mailman/listinfo/fluorine_fluorine.thesil entgroup.com _______________________________________________ fluorine mailing list fluorine@... http://fluorine.thesilentgroup.com/mailman/listinfo/fluorine_fluorine.thesilentgroup.com |
|
|
Re: How can I find the Flex client id?
by Martin Wickman
::
Rate this Message:
Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message I see, things actually makes sense after all :-) To recap; there is a unique id for the whole client assigned by the server, which I should use. And there is a certain id for each agent. By using the global FlexClient.getInstance().id, I should have no problem figure out if the lock is held by the current client or not. Thanks! By the way, when exactly is the FlexClient.id set, during consumer.subscribe or earlier? For instance, I'm using a couple of <mx:RemoteObjects> as well. /Martin ________________________________________ From: fluorine-bounces@... [fluorine-bounces@...] On Behalf Of Support [support@...] Sent: 17 April 2009 18:56 To: 'Fluorine Mailing List' Subject: Re: [Fluorine] How can I find the Flex client id? Hi Martin, FluorineContext.Current.Client.Id is the Flex Client identity (the SWF's identity) that is assigned by the server (and then accessible from the SWF). http://livedocs.adobe.com/livecycle/8.2/programLC/common/langref/mx/messagin g/FlexClient.html mx:Consumer/Producer objects are Message Agents and have their own identity ("charlie" in your example or automatically assigned one if not specified). So your "charlie" id is identifying the message agent and NOT the flex client. The Fluorine context does not currently expose the current message agent identity (if there is any). If your .NET code is running in a custom messaging adapter's Invoke method then the agent identity is the clientId field of the IMessage interface. The weird DSDstClientId is the so called DESTINATION_CLIENT_ID_HEADER set by the server :) "Messages pushed from the server may arrive in a batch, with messages in the batch potentially targeted to different Consumer instances. Each message will contain this header identifying the Consumer instance that will receive the message." Now the question is if you are interested in the Flex Client identity or a specific Message Agent identity? Zoli PS: in v1.0.0.17 you will have access through the FluorineContext.Current.Client (IClient) to the connected IMessageClient(s), IMessageClient being a server representation of a client-side Flex Message Agent. I already started to commit the v1.0.0.17 source code to the SVN however be careful taking it as there are some breaking changes in the API I have to write about... -----Original Message----- From: fluorine-bounces@... [mailto:fluorine-bounces@...] On Behalf Of Martin Wickman Sent: Friday, April 17, 2009 6:45 PM To: fluorine@... Subject: [Fluorine] How can I find the Flex client id? Howdy I've been struggling/sweating for quite some time now how I can get to the name/id that was used when the client connected to FluorineFx through Flex's mx:Consumer object (amf messaging polling). For example, I want to find the "charlie" used in: consumer.subscribe("charlie"); I've tried FluorineContext.Current.Client.Id and other permutations of that, but it only gives me the internal Fluorine id (hex-string like 43bcdec1a9...), not "charlie". Reading lots of Fluorine code led me frustratingly to some abomination like (((MessageDestination)msgBroker.GetDestination(DESTINATION_ID))).Subscriptio nManager.GetSubscribers(asyncMsg); which works, except that it won't compile because MessageDestination is internal. Also, by debugging the message in the Flex client, I see that it in fact contains a clientId property (and a weird header called 'DSDstClientId') which contains the real thing. So apparently it is there somewhere, but where? So please, if possible, shed some light on this. Thanks! (The full story is that I'm implementation a simple locking scheme for my Flex clients and I need to send back the userid to all clients telling who's locking the object at the moment, so each client must know if they are holding the lock or not by comparing their own userid (ie "charlie") to the userid returned in my "object_is_locked_by: 43bcdec1a9..." message) /Martin _______________________________________________ fluorine mailing list fluorine@... http://fluorine.thesilentgroup.com/mailman/listinfo/fluorine_fluorine.thesil entgroup.com _______________________________________________ fluorine mailing list fluorine@... http://fluorine.thesilentgroup.com/mailman/listinfo/fluorine_fluorine.thesilentgroup.com _______________________________________________ fluorine mailing list fluorine@... http://fluorine.thesilentgroup.com/mailman/listinfo/fluorine_fluorine.thesilentgroup.com |
|
|
Re: How can I find the Flex client id?
by Support-179
::
Rate this Message:
Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message Yes :) FlexClient id is set after the first access to the server. It does not matter on which channel (can be from the remoteobject too) When the server first encounters a special header called DSId (with the value "nil") assigns a new identity and that is sent back to the client. After this all messages from the client will send back the DSId = assigned id (so the server can identify the client) (I would say that it is assigned upon the first call, but the call here does not mean a RPC call as there is data sent to the server before there is any RPC call performed) Zoli -----Original Message----- From: fluorine-bounces@... [mailto:fluorine-bounces@...] On Behalf Of Martin Wickman Sent: Saturday, April 18, 2009 5:53 PM To: Fluorine Mailing List Subject: Re: [Fluorine] How can I find the Flex client id? I see, things actually makes sense after all :-) To recap; there is a unique id for the whole client assigned by the server, which I should use. And there is a certain id for each agent. By using the global FlexClient.getInstance().id, I should have no problem figure out if the lock is held by the current client or not. Thanks! By the way, when exactly is the FlexClient.id set, during consumer.subscribe or earlier? For instance, I'm using a couple of <mx:RemoteObjects> as well. /Martin ________________________________________ From: fluorine-bounces@... [fluorine-bounces@...] On Behalf Of Support [support@...] Sent: 17 April 2009 18:56 To: 'Fluorine Mailing List' Subject: Re: [Fluorine] How can I find the Flex client id? Hi Martin, FluorineContext.Current.Client.Id is the Flex Client identity (the SWF's identity) that is assigned by the server (and then accessible from the SWF). http://livedocs.adobe.com/livecycle/8.2/programLC/common/langref/mx/messagin g/FlexClient.html mx:Consumer/Producer objects are Message Agents and have their own identity ("charlie" in your example or automatically assigned one if not specified). So your "charlie" id is identifying the message agent and NOT the flex client. The Fluorine context does not currently expose the current message agent identity (if there is any). If your .NET code is running in a custom messaging adapter's Invoke method then the agent identity is the clientId field of the IMessage interface. The weird DSDstClientId is the so called DESTINATION_CLIENT_ID_HEADER set by the server :) "Messages pushed from the server may arrive in a batch, with messages in the batch potentially targeted to different Consumer instances. Each message will contain this header identifying the Consumer instance that will receive the message." Now the question is if you are interested in the Flex Client identity or a specific Message Agent identity? Zoli PS: in v1.0.0.17 you will have access through the FluorineContext.Current.Client (IClient) to the connected IMessageClient(s), IMessageClient being a server representation of a client-side Flex Message Agent. I already started to commit the v1.0.0.17 source code to the SVN however be careful taking it as there are some breaking changes in the API I have to write about... -----Original Message----- From: fluorine-bounces@... [mailto:fluorine-bounces@...] On Behalf Of Martin Wickman Sent: Friday, April 17, 2009 6:45 PM To: fluorine@... Subject: [Fluorine] How can I find the Flex client id? Howdy I've been struggling/sweating for quite some time now how I can get to the name/id that was used when the client connected to FluorineFx through Flex's mx:Consumer object (amf messaging polling). For example, I want to find the "charlie" used in: consumer.subscribe("charlie"); I've tried FluorineContext.Current.Client.Id and other permutations of that, but it only gives me the internal Fluorine id (hex-string like 43bcdec1a9...), not "charlie". Reading lots of Fluorine code led me frustratingly to some abomination like (((MessageDestination)msgBroker.GetDestination(DESTINATION_ID))).Subscriptio nManager.GetSubscribers(asyncMsg); which works, except that it won't compile because MessageDestination is internal. Also, by debugging the message in the Flex client, I see that it in fact contains a clientId property (and a weird header called 'DSDstClientId') which contains the real thing. So apparently it is there somewhere, but where? So please, if possible, shed some light on this. Thanks! (The full story is that I'm implementation a simple locking scheme for my Flex clients and I need to send back the userid to all clients telling who's locking the object at the moment, so each client must know if they are holding the lock or not by comparing their own userid (ie "charlie") to the userid returned in my "object_is_locked_by: 43bcdec1a9..." message) /Martin _______________________________________________ fluorine mailing list fluorine@... http://fluorine.thesilentgroup.com/mailman/listinfo/fluorine_fluorine.thesil entgroup.com _______________________________________________ fluorine mailing list fluorine@... http://fluorine.thesilentgroup.com/mailman/listinfo/fluorine_fluorine.thesil entgroup.com _______________________________________________ fluorine mailing list fluorine@... http://fluorine.thesilentgroup.com/mailman/listinfo/fluorine_fluorine.thesil entgroup.com _______________________________________________ fluorine mailing list fluorine@... http://fluorine.thesilentgroup.com/mailman/listinfo/fluorine_fluorine.thesilentgroup.com |
| Free embeddable forum powered by Nabble | Forum Help |