Results 1 to 3 of 3
  1. #1

    Problem with multiple subscribe

    I'm trying to write a multiple subscribe using http (C++ Builder, TLCP protocol), as explained in page 30 of protocol specification:

    URL: http://push.lightstreamer.com/lights...col=TLCP-2.1.0

    PARAMS: LS_cid=mgQkwtwdysogQz2BJ4Ji+kOj2Bg\r\nLS_adapter_s et=DEMO\r\n

    R: HTTP/1.0 200 OK


    Server: Lightstreamer-Server/7.1.0 b4 build 1915 (Lightstreamer Server - www.lightstreamer.com) ENTERPRISE edition
    Content-Type: text/enriched; charset=UTF-8
    Cache-Control: no-store
    Cache-Control: no-transform
    Cache-Control: no-cache
    Pragma: no-cache
    Expires: Thu, 1 Jan 1970 00:00:00 GMT
    Date: Fri, 10 May 2019 17:35:25 GMT
    Content-Length: 500000
    Connection: Keep-Alive
    x-accel-buffering: no


    CONEXAO OK -> CONOK,S6c80fb278aabaef7M14aT3525526,50000,5000,*


    URL: http://push.lightstreamer.com/lights...f7M14aT3525526

    PARAMS:
    LS_reqId=1&LS_op=add&LS_subId=1&LS_group=item1&LS_ schema=stock_name+last_price+time+bid+ask&LS_data_ adapter=QUOTE_ADAPTER&LS_mode=MERGE\r\nLS_reqId=2& LS_op=add&LS_subId=2&LS_group=item2&LS_schema=stoc k_name+last_price+time+bid+ask&LS_data_adapter=QUO TE_ADAPTER&LS_mode=MERGE\r\nLS_reqId=3&LS_op=add&L S_subId=3&LS_group=item3&LS_schema=stock_name+last _price+time+bid+ask&LS_data_adapter=QUOTE_ADAPTER& LS_mode=MERGE\r\n

    R: 200 REQOK,3

    It's subscribing only the last item, even if trying with different number of items.


    U,3,1,Bagies Consulting|6.7|19:35:28|6.69|6.7
    U,3,1,|6.77|19:35:30|6.77|6.78
    U,3,1,|6.71|19:35:34|6.7|6.71
    U,3,1,||19:35:36|6.69|


    I tried some variations, like sending LS_cid and LS_adapter_set in the subscription url, but results are the same.

    So:

    1. This is intended to work this way or I've misunderstood the specification ?
    2. What I'm doing wrong ?

    Thanks in advance.

  2. #2
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    538
    Hi rperseguini,

    I can confirm that you have understood the specifications correctly, multiple requests are possible and must be specified in this way, separating the various requests with CR LF characters into the same http command.

    I suppose what happens in your tests is that the end-of-line characters are somehow encoded by the http client tool and therefore not correctly recognized by the server, which processes the received request as a single one.

    This is the test I run with cURL client in linux env (and worked as expected):

    Code:
    curl -v -N -X POST -d "LS_cid=mgQkwtwdysogQz2BJ4Ji+kOj2Bg&LS_adapter_set=DEMO" http://push.lightstreamer.com/lightstreamer/create_session.txt?LS_protocol=TLCP-2.1.0
    
    curl -v -N -X POST --data $'LS_reqId=4&LS_op=add&LS_subId=4&LS_group=item4&LS_schema=stock_name+last_price+time+bid+ask&LS_data_adapter=QUOTE_ADAPTER&LS_mode=MERGE&LS_session=S52d7edf672d5067aM14aT1911842\r\nLS_reqId=5&LS_op=add&LS_subId=5&LS_group=item5&LS_schema=stock_name+last_price+time+bid+ask&LS_data_adapter=QUOTE_ADAPTER&LS_mode=MERGE&LS_session=S52d7edf672d5067aM14aT1911842' http://push.lightstreamer.com/lightstreamer/control.txt?LS_protocol=TLCP-2.1.0
    Regards,
    Giuseppe

  3. #3
    Hello Giuseppe.

    That's it.
    I solved this by manually encoding the subscription lines and adding CR LF for each line later.

    It's working now.
    Thank you very much.

    Best regards,
    Renato
    Last edited by rperseguini; May 13th, 2019 at 03:13 PM.

 

 

Similar Threads

  1. Running Lightstreamer with multiple Adapters problem
    By HassanShehata in forum Adapter APIs
    Replies: 1
    Last Post: May 24th, 2016, 08:31 AM
  2. problem in command subscribe
    By engcoder in forum Client APIs
    Replies: 7
    Last Post: January 27th, 2016, 05:27 PM
  3. Replies: 3
    Last Post: July 29th, 2009, 09:27 AM
  4. Data Adapter's subscribe() method not getting called
    By CitiMan in forum Adapter APIs
    Replies: 8
    Last Post: November 30th, 2006, 04:26 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:09 AM.