質問

I have a tomcat web server running with Java restlet hosting some Java application, and postgreSQL as DB on one server machine (call it machine one). Now for some application, I want the web page hosted in tomcat to call the application code written in C++ on another server machine (call it machine two). Therefore, I need to set up the C++ application code in a way listening to http request (if I understand it correctly). I may add more C++ applications in future on machine two to listening to different application request.

How could I set up the machine two for my purpose? Do I need an equivalent restlet (RESTful) framework for my C++ applications. I have read some documents about CPPCMS, CPPSERV. I also found NginX can support fastCGI. But I am still confused which one or other tools I should use for my C++ programs on machine two.

役に立ちましたか?

解決

You can use Boost Asio to write a simple C++ client or server application listining to some port and transfer data to your tomcat server (or any other server long as it uses standard protocols). Boost asio can be used to do any kind of network programming that you want. It is somehow a low level library for network programming in C++.

you can start by using one of examples from this page:

http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/examples/cpp03_examples.html

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top