Is it possible to “talk” with running process?

后端 未结 4 414
悲哀的现实
悲哀的现实 2020-12-10 09:00

i want to create some service that will run as simple process and will give some other application the possibility to send him xml stream.

What i mean is to create

4条回答
  •  没有蜡笔的小新
    2020-12-10 09:56

    What you are looking for is some form of IPC (Inter-process communuication). There's a huge number of possibilities:

    1. Regular file. Windows provides location specifically for temp files (%TEMP%)
    2. For small data, you could use registry, although in most cases it's not a proper use
    3. Memory-mapped file, it's similar to file but in RAM
    4. As Royi properly mentioned, NamedPipeStream is a way to go if you decide to give pipes a try
    5. You could create a WCF endpoint. It sounds like a drag, but Visual Studio will create you all the scaffolding, so it's not such an issue in the end
    6. Window messages could be used if you are developing forms application, and sometimes even if not
    7. You mentioned that the data is XML, so this methodology is not for you, but I'll mention it anyway: you could use named kernel objects, such as: mutexes, events, semaphores to pass signals from one program to another.

提交回复
热议问题