Results 1 to 10 of 10
  1. #1
    Member
    Join Date
    May 2009
    Location
    Madurai
    Posts
    10

    problem in establishing socket connection from adapter

    I need to establish a new socket connection with another server whenever a subscribe message comes to the adapter. That server will fire the events on the adapter. Then, the adapter will send notification to the client. If I establish socket connection while initializing the adapter, everything is working fine. Instead, If I establish the socket connection while adapter receives subscribe message, none of the events in adapter gets fired.

    Can anyone help me?


    Thanks in advance,
    Latha.P

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,089
    Is the problem in some way related with Lightstreamer interfaces?
    In that case, may you please clarify how your Data Adapter behaves with respect to Lightstreamer interface?
    Are you talking about a Remote Adapter that uses the .NET interface?

    Just in case, I warn you that you cannot open a socket and wait for data on it in the body of a "susbcribe" call; you should do it on a different thread.

  3. #3
    Member
    Join Date
    May 2009
    Location
    Madurai
    Posts
    10
    I am talking about remote adapter(.Net) that implements "IDataProvider". We are using the "DotNetStockListDemo" sample coding only by doing some alteration as per our requirements. The process we need to do is, whenever a client logon through browser, we will send logon message to another external server to validate. That server doesn't reply to the request, but just fires an event as response and also will send notification to clients currently logged on. This all will happen in separate thread only. (Note : We need to establish a new socket connection whenever a client do logon)
    The way we are implementing this logic is, whenever a client logon through browser, client application will send logon message to "DotNetStockListDemo" application by calling "subscribe" function. From there, we will establish a socket connection with external server and send logon request. As mentioned above, none of the events gets fired. Is there any other better way to implement/resolve this? Kindly do help me to sort out this issue.

    Thanks,
    Latha.P

  4. #4
    Administrator
    Join Date
    Jul 2006
    Location
    Milan, Italy
    Posts
    521
    hi Latha,

    I'm not sure i can understand your scenario.

    Please take a look at the general work-flow of how you should manage authentication and subscriptions in your Adapters. See Chapter 4 of "General Concepts.pdf". The Metadata Adapter will be notified of a new user logging on. It will be notified of any subscriptions made by that user too. On the other hand, the Data Adapter will be notified of any new subscription(that is, irrespective of the user provoking it) and has the role of injecting updates on the items related to such subscriptions.

    So, for your requirements perhaps you need to work on the Metadata Adapter, more than on the Data Adapter. You can find the source code of a .NET Metadata Adapter under "\DOCS-SDKs\sdk_adapter_dotnet\examples\DotNetStockListDe mo\src_metadata_adapter".

    Hope that helps.

    -Alessandro

  5. #5
    Member
    Join Date
    May 2009
    Location
    Madurai
    Posts
    10
    Hi,
    Thanks for your information. To use our own metadata adapter, what all changes I need to do on xml file & client application. If I use metadata adapter to connect a user with external server, how can i update client application when external server sends notification(because metadata adapter will only know the external server reference value). Kindly send me the samples if any.

    Thanks & Regards,
    Latha

  6. #6
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,089
    All backend side links needed should be implemented on your side.
    The Metadata Adapter, once informed that a user has logged in, should communicate with your external server, get back the answers and send them to the Data Adapter, by connecting to the latter in some way.
    The Data Adapter could then use this data to answer to the subscription to a user-specific item. Note that you may have to wait for the user to eventually subscribe to that item before returning the data.

    If you want to simplify the process and connect to the external server from the Data Adapter, upon subscription of the user-specific item, this is possible. However, you should still ensure in your Metadata Adapter that the user-specific item can only be requested by the proper user.
    Did you try this way and did you have any problem?

    As we still can't understand your requirements, we can't point you to any of the available example code.

  7. #7
    Member
    Join Date
    May 2009
    Location
    Madurai
    Posts
    10
    I got the source code for metadata adapter from "DotNetStockListDemo" Sample.I have used data adapter only. Don't have any idea about metadata adapter. To use "LiteralBasedProvider.cs" as my meta data adpter, what all changes I need to do on xml file & client application(to validate user logon and so on). And also, Kindly do give me some illustrations how to pass data from meta data adapter to data adapter.


    Thanks,
    Latha

  8. #8
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,089
    If you move from a java Metadata Adapter to an equivalent remote Metadata Adapter, only "adapters.xml" has to be changed. No changes are needed on the client side.
    The StockListDemo example in the distribution package makes use of both a remote Data Adapter and a remote Metadata Adapter. This kind of configuration is shown in
    DOCS-SDKs\sdk_adapter_dotnet\examples\DotNetStockListDe mo\Deployment\Deployment_LS\StockList_sockets\adap ters.xml
    The remote Metadata Adapter must be launched in the same way as the remote Data Adapter.

    Any user validation or similar logic should be added by implementing suitable methods on the Metadata Adapter. You can inherit your own Metadata Adapter from the minimal LiteralBasedProvider and add the implementations needed.

    In order to pass data from the Remote Metadata Adapter to the Remote Data Adapter, their two processes should communicate in some way. The simplest scenario is when you launch the two adapers in the same process. This is shown in
    DOCS-SDKs\sdk_adapter_dotnet\examples\DotNetStockListDe mo\Deployment\Deployment_DotNet_Server(custom)
    where a custom executable, whose source code is shown in
    DOCS-SDKs\sdk_adapter_dotnet\examples\DotNetStockListDe mo\src_standalone_launcher
    contains both the Remote Metadata Adapter object and the Remote Data Adapter object.

  9. #9
    Member
    Join Date
    May 2009
    Location
    Madurai
    Posts
    10
    Hi,
    Attached is detail flow of what we implemented for thick client and what we need to implement for browser application. Kindly help me to sort out this issue.


    Thanks,
    Latha.P
    Attached Files Attached Files

  10. #10
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,089
    As the first step, you should definitely try to have our full .NET example working.
    I mean that you should
    1. configure the Server as shown in
      DOCS-SDKs\sdk_adapter_dotnet\examples\DotNetStockListDe mo\Deployment\Deployment_LS
    2. run the Remote Server deployment shown in
      DOCS-SDKs\sdk_adapter_dotnet\examples\DotNetStockListDe mo\Deployment\Deployment_DotNet_Server(custom)
    3. run a proper version of the StockListDemo client to see the whole system working.

    The detailed instructions are in the
    DOCS-SDKs\sdk_adapter_dotnet\doc\DotNet Adapters.pdf
    document, paragraph 1.4; in particular, you should apply the optional point 4.1

    In that example, both the Remote Data Adapter and the Remote Metadata Adapter run in the same process, so they can communicate with each other and share a dll.
    The "main" method of this process is in DotNetStockListDemoLauncher_N2.exe, which is custom code, whose source file is shown in DOCS-SDKs\sdk_adapter_dotnet\examples\DotNetStockListDe mo\src_standalone_launcher\StandaloneLauncher.cs. There, you can recognize the places where the Metadata and Data Adapter objects are constructed, as lines 104 and 116.
    You can modify the code in order to run your own Adapters.

 

 

Similar Threads

  1. Hello World -- Socket
    By mohelal84@yahoo.com in forum Adapter SDKs
    Replies: 5
    Last Post: March 25th, 2015, 10:26 AM
  2. Replies: 4
    Last Post: February 3rd, 2011, 11:33 AM
  3. Silverlight Client Connection problem in IE
    By kkrisjoy in forum Client SDKs
    Replies: 7
    Last Post: December 17th, 2010, 10:30 AM
  4. Hello World Remote Socket Adapter
    By kclerc in forum Adapter SDKs
    Replies: 7
    Last Post: April 12th, 2010, 12:40 PM
  5. problem building example adapter
    By ebarnhorst in forum Adapter SDKs
    Replies: 1
    Last Post: May 7th, 2007, 06:07 PM

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 06:56 AM.