Results 1 to 9 of 9
  1. #1
    Senior Member
    Join Date
    Aug 2014
    Posts
    71

    sending message from client to adapter

    hello,

    i use the "sendmessage" method to send a message from client to adapter. i use that to send the typed username and password to the adapter to authenticate the user. all that is well done but the problem is when the client have kasper internet security installed on his machine it blocks the sending message or it delayed for approx. 30 seconds.
    how to solve that?

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    975
    Are we correct in assuming that your client is using LS .NET client library?
    In that case, the "sendmessage" operation can only consist in a HTTP request to the Server, so we don't expect that it can be blocked.
    Can you confirm that the block is in the path from the client to the server and not in some consequent data that are expected to go back to the client?
    You can ascertain this by looking at the Server log, in which all the client requests are logged;
    you should recognize a proper send_message.txt request and compare the time with the client-side action.
    Just ensure that the LightstreamerLogger.requests logger is at INFO level.

  3. #3
    Administrator
    Join Date
    Jul 2006
    Location
    Milan, Italy
    Posts
    517
    @engcoder, why are you using sendMessage to authenticate the user, rather than regularly sending the credentials when creating the session?

  4. #4
    Senior Member
    Join Date
    Aug 2014
    Posts
    71
    @Alessandro

    how?

  5. #5
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    543
    Hi engcoder,

    (Still assuming .Net client API) You can use this 2 properties of ConnectionInfo:
    - http://www.lightstreamer.com/docs/cl..._Password.html
    - http://www.lightstreamer.com/docs/cl...Info_User.html

  6. #6
    Senior Member
    Join Date
    Aug 2014
    Posts
    71
    how the adapter receive the user and password of connection info and then control the subscribed items of this specified user?

  7. #7
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    543
    Hi engcoder,

    These tasks should be implemented in the methods of the Metadata Adapter. In particular the user validation in the notifyUser method, and Items authorization logics in the NotifyNewTables method.

    Please also refer to this demo, which shows the source code of a simple MetadataProvider implementation that includes user validation and items authorization logics. I know that this demo is for Java Adapter API but the methods involved are the same of .NET API.

  8. #8
    Senior Member
    Join Date
    Aug 2014
    Posts
    71
    dears,

    i try to send authentication via connection info and receive the user and password on the adapter then authenticate the user.
    when i want the client to receive the authentication result from the adapter, i made a subscribe from the client to an item representing the user authentication result. that item is the username or whatever a key for the user. and the adapter when authenticates the user, it updates the result to the lightstreamer.

    that is the same what i do when using the sendmessage method to send the user and password from client to the adapter.

    but the difference is that when using the send message, the client already subscribe the item of auth result befor the adapter update the item to LS and so the onupdate gets the result at once. but when using connection info authentication, the subscribe is made at the client after connection done and so after the adapter updates the auth result that made me repeat the connection to get auth result at the onupdate.


    now what's your opinion of the way i follow to get the authentication result from the LS adapter and the difference between the both methods done and what is the better one?

  9. #9
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    543
    Hi engcoder,

    Your adapter should keep in cache the authentication response until a call for the NotifyNewTables method for the specific user and the specific custom Item arrives. Then you can post the authentication result as an update for that Item.

    Anyway, please note that we can not say for sure which method is the best, it is for sure that we consider as the preferred option to use the connection properties to pass the user id and the password (or the token returned by an external service).
    If in your architecture is much easier to use the sendmessage you can continue on this option, but I would point out a couple of matters to which pay attention.

    1 In this way, you accept that there are full active Lightstreamer sessions for clients not yet authenticated;
    2 Depending the log setting, the text of a sendmessage is clear logged (while the password passed as a property in the connection is hidden).

    HTH,
    Giuseppe

 

 

Similar Threads

  1. how the adapter sends a message to a specific client
    By engcoder in forum Adapter APIs
    Replies: 1
    Last Post: September 19th, 2014, 10:09 AM
  2. sending message from client to server (adapter)
    By engcoder in forum Client APIs
    Replies: 8
    Last Post: August 26th, 2014, 10:25 AM
  3. Sending a message to the client
    By colmfield in forum Client APIs
    Replies: 2
    Last Post: August 26th, 2010, 10:52 AM
  4. Sending an image to the client
    By mnanda in forum Client APIs
    Replies: 2
    Last Post: July 16th, 2010, 12:04 PM
  5. LS not sending all messages to client
    By mnenchev in forum General
    Replies: 3
    Last Post: April 20th, 2010, 10:10 AM

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 12:05 PM.