-
November 17th, 2014, 03:22 PM
#11
Ok, there are multiple ways in which the data flow can be mapped in terms of items.
In our simple chat implementation, we mapped items to chat rooms, so that different users could subscribe to different chat rooms and receive different data.
On the other hand, you can map a different item to each user, then feed each item with the data that pertains only to that user, depending on the chat rooms she is following.
For hints on the suggested way to work with user specific items, you may see the example in the getItems javadoc.
There is no direct interface to receive a list of connected clients.
What you can do is to implement the notifyNewSession and notifySessionClose methods in your Metadata Adapter to keep track of all the client sessions.
When a client is connected, you should also assume that it will subscribe to the corresponding user-specific item;
if the user name is userA, we may call it "data_for_userA".
The client may send chat messages through the sendMessage method supplied by the client API and this will trigger the notifyUserMessage callback in the Metadata Adapter.
The client may also specify the requested chat rooms through the sendMessage method.
With these premises, the application can route each message to the pertaining clients by feeding the dedicated "data_for_*" items in the Data Adapter.
The above is needed regardless that there is one or multiple Server instances. In the latter case, however, the messages targeted to a user userB should be routed to the Server instance to which userB's client is connected (hence, whose Data Adapter has received the subscription request for the "data_for_userB" item). Unfortunately, this routing, as already pointed out by Gianluca, is not assisted by Lightstreamer.
Similar Threads
-
By bkretschmer in forum Adapter SDKs
Replies: 3
Last Post: August 7th, 2013, 09:00 AM
-
By vampug in forum General
Replies: 4
Last Post: April 12th, 2010, 09:23 AM
-
By mahen in forum Client SDKs
Replies: 1
Last Post: February 23rd, 2009, 11:41 AM
-
By CitiMan in forum Client SDKs
Replies: 2
Last Post: November 21st, 2006, 01:55 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
All times are GMT +1. The time now is 07:01 PM.
Bookmarks