Page 2 of 2 FirstFirst 12
Results 11 to 20 of 22

Hybrid View

  1. #1
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,091
    I warned about synchronization issues with relation to my suggestion of putting a pointer to the Data Adapter on a static variable. I did it just in case.
    If you, after revising your code, can now see that some updates do reach the client, I cant' figure how synchronization problems could cause single updates to be lost.

    It is possible that some events are merged by the Server, if bandwidth or frequency restrictions are configured.
    You can check the event flow through the Server in the Server log, after setting the priority for the "LightstreamerLogger.subscriptions" and "LightstreamerLogger.pump" categories to DEBUG in "lightstreamer_log_conf.xml".

  2. #2
    Senior Member
    Join Date
    Sep 2007
    Location
    des plaines
    Posts
    41
    Here is my latest code with which I am missing some data sometimes:
    using System.Collections;
    using System.Threading;
    using System;
    using System.Runtime.InteropServices;
    using Lightstreamer.Interfaces.Data;
    using System.Windows.Forms;

    public class SocketToLightStreamer : IDataProvider
    {
    private IItemEventListener _listener;
    public void Init(IDictionary parameters, string configFile)
    {
    }

    public bool IsSnapshotAvailable(string itemName)
    {
    return false;
    }

    public void SetListener(IItemEventListener eventListener)
    {
    _listener = eventListener;
    }
    public void Subscribe(string itemName)
    {
    if (itemName.Equals("floorupdate"))
    {
    Form f = new GetMessage(this);
    f.Show();
    f.Hide();
    ApplicationContext ctx = new ApplicationContext();
    Application.Run(ctx);
    }
    }

    public void Unsubscribe(string itemName)
    {
    if (itemName.Equals("floorupdate"))
    {
    }
    }
    public void PushData(string data)
    {
    System.Console.WriteLine(data);
    IDictionary eventData = new Hashtable();
    eventData["scan"] = data;
    _listener.Update("floorupdate", eventData, false);
    }
    public class GetMessage : Form
    {
    const int WM_COPYDATA = 0x004a;
    private SocketToLightStreamer clientUpdater;
    public GetMessage(SocketToLightStreamer o)
    {
    Text = "my_unique_id";
    clientUpdater = o;
    }

    protected override void WndProc(ref System.Windows.Forms.Message m)
    {
    switch (m.Msg)
    {
    case WM_COPYDATA:
    COPYDATASTRUCT mystr = new COPYDATASTRUCT();
    Type mytype = mystr.GetType();
    mystr = (COPYDATASTRUCT)m.GetLParam(mytype);
    new Thread(delegate() { clientUpdater.PushData(mystr.Data); }).Start();
    break;
    }
    base.WndProc(ref m);
    }
    }
    [StructLayout(LayoutKind.Sequential)]
    public struct COPYDATASTRUCT
    {
    public Int32 ID;
    public int Length;
    public string Data;
    }
    }

    I see missing data in the Console written in PushData method.

    Here is sample of data being lost:
    22-Aug-08 08:19:41,266 |TRACE|LightstreamerLogger.pump |PUMP POOLED THREAD 1 |Pumping event in session Sa4839d7557b06b92T1742762: d(1,1,1,"08:19:40^text2\u000D");
    22-Aug-08 08:19:42,266 |TRACE|LightstreamerLogger.subscriptions|#1 Notify Receiver |INCOMING DATA for floorupdate --> {scan=08:19:41^text1
    }
    22-Aug-08 08:19:42,266 |DEBUG|LightstreamerLogger.subscriptions|#1 Notify Receiver |Manager: com.lightstreamer.e.s@8046f4
    22-Aug-08 08:19:42,266 |TRACE|LightstreamerLogger.pump |PUMP POOLED THREAD 1 |Pumping event in session Sa4839d7557b06b92T1742762: d(1,1,1,"08:19:41^text1\u000D");
    22-Aug-08 08:19:43,376 |TRACE|LightstreamerLogger.subscriptions|#1 Notify Receiver |INCOMING DATA for floorupdate --> {scan=08:19:43^text2
    }

 

 

Similar Threads

  1. Database Feed
    By mode_vigilante in forum Adapter SDKs
    Replies: 16
    Last Post: January 27th, 2012, 03:58 PM
  2. .NET web service as Data Feed
    By icaiozzi in forum Adapter SDKs
    Replies: 1
    Last Post: November 19th, 2010, 11:52 AM
  3. How to deploy on an external Web Server?
    By AndyKelly in forum Client SDKs
    Replies: 1
    Last Post: July 7th, 2010, 10:50 AM
  4. How And Where To Specify Database As Data Feed?
    By devidasan in forum Adapter SDKs
    Replies: 1
    Last Post: March 17th, 2009, 11:00 AM
  5. External deployment
    By markgoldin in forum General
    Replies: 6
    Last Post: September 28th, 2007, 01:15 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 10:06 AM.