Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 552 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 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,725
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,725
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,725
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

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

Chief Engineer
jcl  Offline

Chief Engineer

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