-
August 24th, 2015, 07:31 AM
#1
LSClient.BatchRequests Method doesn't work
Hello,
I try to use BatchRequests (http://www.lightstreamer.com/docs/cl...pi/frames.html). But when i called it, program stopped work. It looks like deadlock.
var connectionInfo = new ConnectionInfo
{
PushServerUrl = serverUrl,
Adapter = Adapter,
User = SessionManager.UserName,
Password = SessionManager.SessionId,
ContentLength = 0,
Constraints = { MaxBandwidth = MaxBandWidth },
};
client.OpenConnection(connectionInfo, this);
client.BatchRequests(3); // without these line works correctly.
client.SubscribeTable(adapters[1].CreateTableSimple(), adapters[0].Listener, false); // deadlock here
client.SubscribeTable(adapters[2].CreateTableSimple(), adapters[0].Listener, false);
client.SubscribeTable(adapters[3].CreateTableSimple(), adapters[0].Listener, false);
client.SubscribeTable(adapters[4].CreateTableSimple(), adapters[0].Listener, false);
Can anyone help me?
Thanks.
-
September 2nd, 2015, 11:27 AM
#2
A condition that we state for the use of the BatchRequests method is that all requests to be batched have to be issued in their own threads.
This is needed because requests such as SubscribeTable are blocking and release the control only after the Server response.
Spawning 4 temporary threads, each one only devoted to a single SubscribeTable invocation should be enough.
As long as the parameter of BatchRequests is 3, upon the third invocation the cumulative request will be issued; then, the request that has come fourth will be issued separately. If you have any reason to force an order (that is, the request for adapters[4] must be issued last), then some complication is needed.
We apologize for the delayed answer.
Similar Threads
-
By ullas.d in forum Client SDKs
Replies: 10
Last Post: August 23rd, 2015, 11:19 AM
-
By lizsedley in forum Client SDKs
Replies: 1
Last Post: October 21st, 2009, 10:19 AM
-
By chuan_ckc in forum Client SDKs
Replies: 1
Last Post: August 20th, 2009, 10:29 AM
-
By shreyaspurohit in forum Client SDKs
Replies: 6
Last Post: December 15th, 2008, 01:27 PM
-
By tuongkha in forum Adapter SDKs
Replies: 4
Last Post: January 30th, 2008, 01:47 PM
Tags for this Thread
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:24 AM.
Bookmarks