I'm developing a plugin application for my dissertation research on multi-application environment. I have an application server that communicate with the PDF document via plugin.
The plugin acts as both client and server, depending on the situation.
- Plugin as Server
I have a multi-threaded winsock2 IOCP running to catch client connections and when a client connected, get the data from the client (set of words), and highlight these words in the pdf document.
- Plugin as client
I use 2 procedures, one to collect all the text from PDF and send to the server using tcp win-socket connection and another to collect data from highlight tool and send these text. both these are not threaded.
Here's my question, because I want to listen to multiple client connections, when the plugin is the server, I'm running this procedure in a thread and then wait for clients to connect and use IOCP to serve the client connections. When the client is connected I use the data coming from client to highlight some text in the PDF document. All of these functionalities are already implemented, but when I receive data from client and try to highlight text in the PDF document my application freezes up and stop working. I think this is something to do with the thread. I'm using _beginthreadex to start the server and then another _beginthreadex inside the IOCP worker thread.
I can post the code, but before that let me know if you can see any problem in this situation. What I see from other posts is that acrobat is not multi-threaded.