Results 1 to 9 of 9
  1. #1
    Member
    Join Date
    Jul 2006
    Location
    London
    Posts
    5

    Standalone application

    Hello dear colleagues,

    It there a possibility to get somewhere a full example of a stand-alone .NET application connecting to the Lightstreamer?

    From the ReadMe.pdf it's clear how to connect the data adapter to the DataProviderServer object, for the metadata provider it should be very similar, but it's not clear at all how to use RequestStream, ReplyStream and NotifyStream properties, WHAT EXACTLY to pass there and how to use these streams then...

    Thanks in advance for the reply,
    Nikit ZYKOV
    Signature Technologies CTO

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan, Italy
    Posts
    515
    Hi Nikit,

    The .NET Adapter API uses the Adapter Remoting Infrastructure (ARI) in roder to allow developers to write Lightstreamer Data and Metadata dapters with .NET instead of Java. So you don't need to see any streams, that are transparently handled by the ARI.

    Perhaps you are referring to a .NET stand-alone application that should be a CLIENT of Lightstreamer (i.e. receive data from LS and not send data to LS as a feed)?

    Cheers

  3. #3
    Member
    Join Date
    Jul 2006
    Location
    London
    Posts
    5
    Hi Alessandro,

    I refer to the _server_ application, using only the DLL version of your connector, referred in the readme.pdf as "How to run the .Net adapter from inside your application". It's stated there that I have to set RequestStream, ReplyStream and NotifyStream properties for the DataProviderServer object, and I don't see what to put to these properties and why do I have to use these streams...

    Regards,
    Nikit

  4. #4
    Member
    Join Date
    Jul 2006
    Location
    London
    Posts
    5
    An other question: what's the port number you're using for your remoting connections?

  5. #5
    Member
    Join Date
    Sep 2006
    Location
    Bologna
    Posts
    2
    Hi Nikit.

    The three stream properties need to be set to three streams connected to the Java remote adapter counterpart. For example, something like this could do the job:

    Code csharp:
    1. TcpClient rrSocket= new TcpClient(host, rrPort);
    2. TcpClient notifSocket= new TcpClient(host, notifPort);
    3.  
    4. server.RequestStream= rrSocket.GetStream();
    5. server.ReplyStream= rrSocket.GetStream();
    6. server.NotifyStream= notifSocket.GetStream();

    The three streams must be supplied by you because they could be obtained in any way: network socket streams, local piped input/output streams, or anything else. Moreover, there's no standard way of controlling their connection status and how to recover connection failures: the provided server implementation simply exits on connection drop, but you can override its behaviour by overriding the OnException method.

    Best regards,

    Gianluca

  6. #6
    Member
    Join Date
    Jul 2006
    Location
    London
    Posts
    5
    Hi Gianluca,

    Ok, in this case my question is how to connect these streams, I have look at the properties of the LightStreamer server, right? In the Lightstreamer configuration that you provide in standard, if I run the .NET server and the Lightstreamer server on the same machine, which port numbers do I use for localhost and where these ports are configured in the LightStreamer configuration?

    Regards,
    Nikit

  7. #7
    Administrator
    Join Date
    Jul 2006
    Location
    Milan, Italy
    Posts
    515
    The configuration of the TCP ports can be found in the adapters.xml file of the Proxy Adapters (i.e. the NetworkedMetadataProvider and NetworkedDataProvider classesthat are contained in ls-remote-adapter.jar).

    For a full example of such configuration please refer to:
    Lightstreamer\sdk_for_dotnet-adapters\examples\DotNetStockListDemo\Standalone_V ersion_Deployment\Deployment_LS\StockList_sockets\ adapters.xml

    If you prefer to use a pipe commumication, refer to:
    Lightstreamer\sdk_for_dotnet-adapters\examples\DotNetStockListDemo\Piped_Versio n_Deployment\Deployment_LS\StockList_pipes\adapter s.xml

  8. #8
    Member
    Join Date
    Jul 2006
    Location
    London
    Posts
    5
    Hi Alessandro,

    Do you mean by this that I have to use two server objects: one for data and one for metadata adapter? I see that in the config files the port numbers are different for two cases...

    And as I have only one request_reply_port parameter for each, I use for each of two adapters the same port numbers for the request and reply streams with simply two distinct TcpConnect objects, right?

    Regards,
    Nikit

  9. #9
    Administrator
    Join Date
    Jul 2006
    Location
    Milan, Italy
    Posts
    515
    Nikit,

    Basically you have to create three client sockets (two for the Data Adapter and one for the Metadata Adapter).

    Example:

    Code csharp:
    1. MetadataProviderServer metadataServer = new MetadataProviderServer();
    2. DataProviderServer dataServer = new DataProviderServer();
    3.  
    4. TcpClient metadataRRSocket = new TcpClient(host, 6663);
    5. TcpClient dataRRSocket = new TcpClient(host, 6661);
    6. TcpClient dataNotifySocket = new TcpClient(host, 6662);
    7.  
    8. metadataServer.RequestStream = metadataRRSocket.GetStream();
    9. metadataServer.ReplyStream = metadataRRSocket.GetStream();
    10. dataServer.RequestStream = dataRRSocket.GetStream();
    11. dataServer.ReplyStream = dataRRSocket.GetStream();
    12. dataServer.NotifyStream = dataNotifySocket.GetStream();

 

 

Similar Threads

  1. Launch LS application.
    By karthik in forum Client APIs
    Replies: 3
    Last Post: July 7th, 2010, 10:43 AM
  2. createEngine problem on ASP.NET application
    By gmotodd in forum Client APIs
    Replies: 8
    Last Post: May 4th, 2009, 12:51 PM
  3. Standalone launcher
    By sjohn in forum Adapter APIs
    Replies: 7
    Last Post: February 18th, 2008, 08:50 AM
  4. Gracefully disconnect standalone .NET adapters
    By riaanj in forum Adapter APIs
    Replies: 15
    Last Post: September 26th, 2007, 09:30 AM
  5. .NET Standalone Adapter with Client
    By wattsw in forum Adapter APIs
    Replies: 2
    Last Post: November 13th, 2006, 05:12 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:12 AM.