BulkTickHandler Throw Null Exception

37 views
Skip to first unread message

Canbaz

unread,
Apr 12, 2019, 9:14:48 AM4/12/19
to NJ4X Forum
Hi,

I defined BulkTickHandler delegate method as a class property:

public static event Strategy.BulkTickHandler TickHandler1;

And I call delegate method before connection:

Client = new Strategy();

Client.SetBulkTickListener((ticks, con) => {
    TickHandler1(ticks, con);
});

Client.Connect(ClientSettings.Host, ClientSettings.Port, ClientSettings.Broker, ClientSettings.LoginId, ClientSettings.Password, true);

But, TickHandler1 throw null exception. 

Extra Info: I use Personal Terminal Server, v2.8.5

Apologize for bad english

Thank you

Roman Gerasimenko

unread,
Apr 12, 2019, 9:20:23 AM4/12/19
to NJ4X Forum
You may need to initialize TickHandler1 variable somewhere, e.g.

public static event Strategy.BulkTickHandler TickHandler1 = (ticks, connection) =>
{
foreach (var tick in ticks)
{
Console.WriteLine($"tick: {tick}");
}
};

пт, 12 квіт. 2019 о 16:14 Canbaz <hc.d...@gmail.com> пише:
--
You received this message because you are subscribed to the Google Groups "NJ4X Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nj4x+uns...@googlegroups.com.
To post to this group, send email to nj...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Can Dolgun

unread,
Apr 12, 2019, 9:36:35 AM4/12/19
to NJ4X Forum
Thank you so much
Reply all
Reply to author
Forward
0 new messages