How to make a stock-market-like app?
-
wrote on 26 Apr 2019, 14:53 last edited by
I want to make an app which could receive data from server once a second automatically when open it. I don't have any ideas to build it. Use RESTful API or something?
Many thanks. -
I want to make an app which could receive data from server once a second automatically when open it. I don't have any ideas to build it. Use RESTful API or something?
Many thanks.wrote on 26 Apr 2019, 15:07 last edited by@Bayesky said in How to make a stock-market-like app?:
app which could receive data from server
Are both the client app and the server things that you can develop?
If so, I can think of 2 approaches maybe:
- use MQTT and the publish/subscribe paradigm -> your client will subscribe to whatever topic(s) you want on start and then it will receive any updates whenever the server publish new data on such topic(s)
- use WebSocket protocol so to have full-duplex communication channels over a single TCP connection
-
wrote on 29 Apr 2019, 01:35 last edited by
@Pablo-J-Rogina
According to your useful advice, I installed Redis on the server and hiredis on my Mac. When I usegcc -o RedisTest RedisTest.c -lhiredis
, it works well.
But when I added this library into Qt ( useLIBS += -L/usr/local/lib/ -lhiredis
), an error occurred which said'hiredis/hiredis.h' file not found
.
How should I do to solve this problem? -
@Pablo-J-Rogina
According to your useful advice, I installed Redis on the server and hiredis on my Mac. When I usegcc -o RedisTest RedisTest.c -lhiredis
, it works well.
But when I added this library into Qt ( useLIBS += -L/usr/local/lib/ -lhiredis
), an error occurred which said'hiredis/hiredis.h' file not found
.
How should I do to solve this problem?you need to add an
INCLUDEPATH
in your pro file to point to the directory where the includes are found.The
LIBS
line looks already good, but is used by the linker at a later step.Regards
-
wrote on 30 Apr 2019, 12:06 last edited by
@aha_1980 said in How to make a stock-market-like app?:
ectory where the includes are found.
Thank you. I have succeed in connection!
3/5