Search code examples
cwindowsdllclienttcpclient

How to set up windows client to web-based dll


I have an application that began its life as a C#-based Windows GUI that used marshalling to talk to a C DLL.

I now need to separate the Windows client and DLL so that the client is installed on a remote PC and communicates with the C DLL over the internet. A further complication is that I want to have multiple Windows clients connecting to the C DLL.

This whole world is new to me, so excuse me if the following are naive questions.

My questions:

0) What is the best method for having the client communicate with the DLL over the internet? TCP/IP Sockets?

1) I need to make modifications to my DLL to have it service multiple clients. But I need some piece of middleware that collects the queries from the different clients, feeds them to the DLL, and then sends the results back to the appropriate client. Is there any code (such as node.js) that would facilitate this?


Solution

  • Regarding: What is the best method for having the client communicate with the DLL over the internet?

    Your suggestion of using TCP/IP could certainly (and likely will) be part of the solution, but there will be other components of the solution as well. The direction you choose will in part be made by answering whether you are using standard marshaling (COM), or custom? At the very least, your problem description suggests a scenario requiring interprocess communications.
    There are many ways to implement. This diagram maps out a general approach, that based on your description might apply:

    Components of Interprocess Communications

    enter image description here

    Read more here

    Regarding: make modifications to my DLL to have it service multiple clients...

    The dll is simply a file like any other. Several processes can read, and subsequently own content from, a file as long as the processes doing the reading adhere to common file access rules. I do not think you will have to modify your dll, at least for that reason. Just make sure the processes accessing the dll comply with safe file access protocols. (Safe file access).