Gamestudio Links
Zorro Links
Newest Posts
How to install R ?
by Clifford_B. 10/16/19 18:05
Indices & metals easier to trade than FX???
by StefanCGN. 10/15/19 16:19
Can't plot daily high & low
by Zheka. 10/14/19 18:39
TWS "Market closed" fix
by jcl. 10/14/19 15:09
2xCapital slider to increase size
by jcl. 10/14/19 14:03
Imgui Lite-c Development
by txesmi. 10/13/19 09:40
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
10 registered members (Phrendo, AndrewAMD, Clifford_B, 3run, Dooley, sdh309795gaas, Superku, Shutch, kvm, 1 invisible), 625 guests, and 31 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Clifford_B, Paulius, Junker, FrankW, TedMar
18307 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
broken plugin help #477159
05/25/19 14:26
05/25/19 14:26
Joined: Jul 2017
Posts: 2
H
hfat Offline OP
Guest
hfat  Offline OP
Guest
H

Joined: Jul 2017
Posts: 2
Hello, Im a zorro beginner. I've recently bought zorro S and Im working on implementing a broker plugin for wcx exchange.
I've managed to implement a few broker plugin functions with no issue. Using TestTrade.c I can connect to the exchange, get my balance, get tradable assets, get prices, send orders etc. This is all done using REST. However wcx encourages the use of WSS rather than REST when it comes to ticking data like prices, and order/trades updates.
So I thought to use libwebsocket for the purpose, and by linking it in, with or without openssl support, zorro does not recognize my dll any more. I cannot see it in the dropdown for the broker selection, but I dont get any error at all, not even something in any log file.
How would I find out what is wrong?

Re: broken plugin help [Re: hfat] #477160
05/25/19 15:21
05/25/19 15:21
Joined: Feb 2017
Posts: 769
Chicago
AndrewAMD Online
User
AndrewAMD  Online
User

Joined: Feb 2017
Posts: 769
Chicago
It's hard to say with this small amount of context. It might depend on how and when that library is getting loaded.

I made a TCP socket plugin, using Boost Asio. If I had to do websockets, I would use Beast + Asio.

I've always needed to make sure that no networking objects were allocated into memory before BrokerLogin is called. Otherwise, the plugin would not be recognized.

Re: broken plugin help [Re: AndrewAMD] #477186
05/28/19 19:33
05/28/19 19:33
Joined: Jul 2017
Posts: 2
H
hfat Offline OP
Guest
hfat  Offline OP
Guest
H

Joined: Jul 2017
Posts: 2
apologize for the lack of context, but there is not much else I can see.
your suggestion is interesting, I went through my code and Im not directly doing any network object allocation before broker login, however, libwebsocket.h include might declare, but hopefully not define, something that is causing the problem.
when you say "I've always needed to make sure that no networking objects were allocated into memory before BrokerLogin", what was actually preventing zorro from seeing the dll ?
thanks

Re: broken plugin help [Re: hfat] #477187
05/28/19 20:31
05/28/19 20:31
Joined: Feb 2017
Posts: 769
Chicago
AndrewAMD Online
User
AndrewAMD  Online
User

Joined: Feb 2017
Posts: 769
Chicago
No idea, Zorro.exe loads the DLL and then unloads it for reasons I do not understand.

Just play around with your plugin until it works. wink

Re: broken plugin help [Re: AndrewAMD] #477190
05/29/19 07:52
05/29/19 07:52
Joined: Jul 2000
Posts: 27,029
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,029
Frankfurt
Zorro first checks if the DLL can be opened with LoadLibrary. If so, it checks if there is a BrokerOpen function and if it returns 2. If both conditions are fulfilled, the DLL is registered and appears in the scrollbox. BrokerLogin is not relevant for registering.

LoadLibrary fails when DllMain uses locks or something like that, or when the DLL relies on another module that's missing. The more complex libraries you're using, the more likely is your DLL to fail on some PCs. Maybe you get details about LoadLibrary requirements on Microsoft forums.

Check your DLL's dependencies with Dependencywalker. Often you can then already see the problem. For debugging, place breakpoints in DllMain and BrokerOpen and check what's happening when Zorro starts.


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1