-
October 14th, 2014, 01:26 PM
#1
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?
-
October 15th, 2014, 08:50 AM
#2
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.
-
October 15th, 2014, 09:55 AM
#3
@engcoder, why are you using sendMessage to authenticate the user, rather than regularly sending the credentials when creating the session?
-
October 15th, 2014, 10:30 AM
#4
-
October 16th, 2014, 09:48 AM
#5
-
October 16th, 2014, 10:19 AM
#6
how the adapter receive the user and password of connection info and then control the subscribed items of this specified user?
-
October 16th, 2014, 01:46 PM
#7
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.
-
October 19th, 2014, 02:03 PM
#8
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?
-
October 20th, 2014, 12:10 PM
#9
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
-
By engcoder in forum Adapter SDKs
Replies: 1
Last Post: September 19th, 2014, 09:09 AM
-
By engcoder in forum Client SDKs
Replies: 8
Last Post: August 26th, 2014, 09:25 AM
-
By colmfield in forum Client SDKs
Replies: 2
Last Post: August 26th, 2010, 09:52 AM
-
By mnanda in forum Client SDKs
Replies: 2
Last Post: July 16th, 2010, 11:04 AM
-
By mnenchev in forum General
Replies: 3
Last Post: April 20th, 2010, 09:10 AM
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 04:09 AM.
Bookmarks