Results 1 to 2 of 2
  1. #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.

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,089
    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

  1. Android sample doesn't work with local installation
    By ullas.d in forum Client SDKs
    Replies: 10
    Last Post: August 23rd, 2015, 12:19 PM
  2. Replies: 1
    Last Post: October 21st, 2009, 11:19 AM
  3. form POST method vs GET method
    By chuan_ckc in forum Client SDKs
    Replies: 1
    Last Post: August 20th, 2009, 11:29 AM
  4. LSClient Not giving any error if the LS Server is not running
    By shreyaspurohit in forum Client SDKs
    Replies: 6
    Last Post: December 15th, 2008, 02:27 PM
  5. Replies: 4
    Last Post: January 30th, 2008, 02:47 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 09:19 AM.