CodePudding user response:
I am in a c + + server adds support for Google Protocol Buffer, written in c + + language in Java and netty an APP is no longer under the words, the question is how to make the Java application with a web page, for the c + + server sends the message?CodePudding user response:
Look not to understand your specific what to achieve, can only guess at the wordJava in regard to the development of the WEB server function is very strong, especially its internal integration of the WEB module is very perfect and powerful
The industry recognized, can find help c + +, JAVA, can I use the experience of the BCB, couldn't find the address code is widespread in c + +, and JAVA can not find, though not necessarily, than c + + easy to find estimates that it is possible to
As for communication, in fact is related to two aspects, one is the use of the interface, the second is the data structure, the two
Correctly implemented can correct communication
CodePudding user response:
Mainly achieve change CS structure of software to BS, server program is done in c + +, the client is also a through c + +, realize link through the socket, after if I want to change to BS, a kind of method is in application to write a lightweight HTTP server thread, the business process and HTTP server tightly coupled method, it is difficult to extend, and write their own HTTP server stress test cannot guarantee, so consider service program and HTTP server, c + + in c + + and Java program communication, then the powerful functions of Java web second encapsulation of c + + communication, and from the business logic and communication logic separation, no matter how many people on the web, stress on the HTTP server, the current market popular such as nginx compressive tests are very strong, has nothing to do with c + + service program, understand?CodePudding user response:
Eldest brother, you this kind of structure in the middle after two conversion result to the client, efficiency, and in the middle of the communication between the two programs are developed respectively, the development and change of efficiency is very low, so is not recommendedCodePudding user response:
However, your c + + code can be encapsulated into a DLL or using ole interfaceCodePudding user response:
Thank you very much for your reply: you mean the server operation part of the API is packaged into a DLL, for Java web call?CodePudding user response:
But the truth is still the same, the DLL will responsible for and the background of c + + server program for communication, at the same time it can also lead to a DLL and tight coupling between the server program, without using Google Protocol Buffer and platform independent of the communications plan is good,CodePudding user response:
You use the JAVA server, so that even c + + server? That c + + servers fail, the algorithm is part of the c + + implementation such as encapsulated into a DLL for JAVA server call not can reduce the communication between the two?If must keep the c + + server, JAVA server is equivalent to a forwarding server, as long as you achieve your c + + client communication ability and the communication protocol interface and data structure and correctly use what tools development, there is no relationship between
If you want to by adding a Java server ease the burden on c + + server must put the Java server into a buffer pool, otherwise does not reduce the burden of c + + server
CodePudding user response:
Some understand, thank you very much, and finally to exe files to c + + DLL encapsulation, and then use similar jnative library to enable services, call the service routine of correlation function interface,CodePudding user response:
This approach also never get, some of the workload, the server program calls for a lot of other third-party libraries, can you do it also will need the following experiment, but this is harder to debug,CodePudding user response:
Special or under the Linux environment, using the GDB to debug