Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Edgar_Herrera, VoroneTZ, Akow), 973 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 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: 10
F
fab Offline OP
Newbie
fab  Offline OP
Newbie
F

Joined: Jul 2017
Posts: 10
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: fab] #477160
05/25/19 15:21
05/25/19 15:21
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,718
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: 10
F
fab Offline OP
Newbie
fab  Offline OP
Newbie
F

Joined: Jul 2017
Posts: 10
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: fab] #477187
05/28/19 20:31
05/28/19 20:31
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,718
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,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
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.


Moderated by  Petra 

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