Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Jul 2007
    Location
    Bangalore
    Posts
    1

    Unable to create New DotNET Adapter

    Hi,
    I am trying to build my DotNet Adapter for Lightstreamer Server v. 3.4.4 build 1361.
    But unable to use the sample given by LIghtstreamer.Can any one help me with DotNet sample programs for building a custom Adapter.

    Thanks.

  2. #2
    Member
    Join Date
    Jul 2007
    Location
    Stockholm
    Posts
    5
    Quote Originally Posted by shobha
    Hi,
    I am trying to build my DotNet Adapter for Lightstreamer Server v. 3.4.4 build 1361.
    But unable to use the sample given by LIghtstreamer.Can any one help me with DotNet sample programs for building a custom Adapter.

    Thanks.
    I got the same problem. I tried the stand alone Socked sample in the SDK (PDF) and wrote a DotNetServer hocking up to the LightStream Request/Reply port (RRPort) (6661) and that seems ok, the problem is that the NotifyStream needs to be hooked up on another port (6662) (And the MetaData Provider adapter is connected sucessfully as in the manual). In the adapters.xml (StockList_sockets) there's two definitions, MetaDataProvider and DataProvider. Seems as the Lightstream doesnt start the DataProvider notify listener for me (can't see any port 6662 via cmd > netstat).

    I'm going to try the piped mode instead, as I understood it, you'll put the DotNetServer into the path specified in MetaDataProvider AdapterClass. Still I'm not sure whether the DataProvider AdapterClass will kick, as it didn't with sockets for me.

    I think a Step-By-Step instruction is needed for the dot net.


    Edit:

    From the PDF Manual:

    NOTE: Lightstreamer Server must be up and running in order for the Remote .NET Adapters to attach
    to its Proxy Adapters. Furthermore, if both the Proxy Metadata Adapter and Proxy Data Adapter are
    used, then the Remote .NET Metadata Adapter should attach to the Proxy before the Remote .NET
    Data Adapter.

    Does this says that the MetaData Adapter have to be initialized first? Looking at the sourcecode in StandAloneLauncher.cs in the SDK the DataProvider is Started first WITH the NotifyPort, then the MetaData Provider is initialized later with te Request/Reply port.

    My guess is that It didn't work out for me cause I initialized the metadata provider with the rrport first (as the manual reffered).

  3. #3
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,089
    Hi

    I confirm that the Proxy Adapter running on Lightstreamer Server needs to receive the connection (on port 6663) from the Remote Metadata Adapter before it ever starts listening for the connections (on ports 6661 and 6662) from the Remote Data Adapter.
    Admittedly, the StandaloneLauncher.cs source code is misleading (and it will be changed as soon as possible), as it shows the Data Adapter part of the initialization before the Metadata Adapter part.
    However, the socket connections for both the Data and Metadata parts are performed by the "Launch" method asynchronously, in dedicated threads; so, this is still consistent with the constraint that the Metadata Adapter connection must precede the Data Adapter connections.

    On the other hand, the Proxy Adapter waits for the two connections related with the Remote Data Adapter in different threads; so, no order constraints are put on the connections performed on the remote side.

    If you started from the StandaloneLauncher.cs code but didn't spawn separate threads for the connections, this can explain your problems (and we apologize for the misleading code). Otherwise, we need more details about both your cases.

    Dario

  4. #4
    Member
    Join Date
    Jul 2007
    Location
    Stockholm
    Posts
    5

    .NET Adapter throws exception.

    Thank you for your answer Dario.

    After some tweaking I got it all working. I initialized sockets as in the sample SDK code for StandAloneLauncher and started the MetaDataAdapter (6663) first in a separate threadstarter thread, then the lightstream started a listener at the request/response port (6661), so I hooked up my tcp socket for dataadapter to port 6661 and that did worked out fine (and notify port 6662).

    Edit:

    Ok, based on the SDK:s StandAloneLauncher and LiteralBasedProvider source I created a custom metadataadapter::MetadataProviderAdapter and a custom dataadapter::IDataProvider

    I have my custom DotNetServer running fine (rrport 6661, notifyport 6662 and metadataport 6663) and lightstreamer is calling the Init() methods in both Metadataclass and dataclass (and also the SetListener() method in dataadapter).

    But the parameters and configFile variables are null in both each time the methods (data:s public void Init(IDictionary prameters, string configFile) and metadata:s public override void Init(IDictionary parameters, string configFile))are called. I have defined param elements with name attributes and values in the adapters.xml file but it seems like the LS server dosn't pass the parameters to the Init() methods?

  5. #5
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,089
    Hi

    I confirm that there is no transport of initialization parameters from the local adapter.xml file (by which the Proxy Adapters are configured) to the remote Adapters.
    Only with the special "piped mode" configuration, the Proxy Adapter launches the Remote Server and provides it with configuration parameters it found in its own configuration.
    When the Remote Server is launched as a standalone process, the Adapter parameters should be put on the Remote Server command line. Moreover, when a custom Remote Server is used, as in your case, the parameters for the Adapters have to be provided by custom code, by putting them into the "AdapterParams" and "AdapterConfig" members of the "MetadataProviderServer" and/or "DataProviderServer" instances, before calling "Start".

    Dario

 

 

Similar Threads

  1. dotnet demo Portfolio-Basic not work fine
    By lisicnu in forum Adapter SDKs
    Replies: 3
    Last Post: December 8th, 2011, 03:41 AM
  2. how to create Adapter Set
    By msgiribabu in forum Adapter SDKs
    Replies: 2
    Last Post: January 31st, 2011, 12:32 PM
  3. Replies: 18
    Last Post: March 19th, 2008, 11:00 AM
  4. How to create Data Adapter?
    By Hanumant in forum Adapter SDKs
    Replies: 3
    Last Post: January 29th, 2008, 04:42 PM
  5. DotNet Adapter
    By VietXuan in forum Adapter SDKs
    Replies: 3
    Last Post: November 5th, 2007, 10:41 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 11:02 AM.