简体   繁体   English

C ++应用程序和服务器之间的数据传输

[英]Transfer of data between C++ application and server

I have an application that generates data and i'd like to transfer this to a database. 我有一个生成数据的应用程序,我想将其传输到数据库。 The application is written in C++. 该应用程序是用C ++编写的。 I'm considering packaging up the data into JSON format and then sending that via libCurl to a server running PHP via a HTTP POST request. 我正在考虑将数据打包为JSON格式,然后通过libCurl通过HTTP POST请求将其发送到运行PHP的服务器。 The data to be transferred is not that large. 要传输的数据不是那么大。 Maybe 100K/day. 也许每天10万。

Have others done something similar? 其他人做了类似的事情吗? Maybe there are better alternatives. 也许有更好的选择。

You could have a look at having your c++ application talk directly to your MySQL database with MySQL++ . 您可以看看让您的c ++应用程序通过MySQL ++直接与您的MySQL数据库对话。 This library is essentially a wrapper around the MySQL C API with an LGPL license. 该库实质上是具有LGPL许可证的MySQL C API的包装。

You could also expose access to the database via a webservice with a Restful API, which would go nicely with handling the json data. 您还可以通过带有Restful API的Web服务公开对数据库的访问,这将很好地处理json数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM