开发者

Communicating applications without Event hooks

开发者 https://www.devze.com 2022-12-19 08:34 出处:网络
I want to have my applications communicate to each other. I think something like a server-client model would suit me well, b开发者_JAVA百科ut I was also wondering if there was a different way. I want

I want to have my applications communicate to each other. I think something like a server-client model would suit me well, b开发者_JAVA百科ut I was also wondering if there was a different way. I want this way to not involve those windows event hooks.


Note:

I am assuming you want to communicate with different processes on the same machine, although many of these concepts can apply across computers as well.


What you are looking for is IPC (Inter Process Communication).

You can do IPC via:

  • File
  • Signal
  • Socket
  • Message queue
  • Pipe
  • Named pipe
  • Semaphore
  • Shared memory
  • Message passing
  • memory-mapped file

My personal recommendation is a loopback connection via socket commands. It is difficult to give you much help beyond that without knowing more details about what you want to do.


You could loopback over Ethernet or use named pipes.

Look up Inter-process Communication (IPC) for a list of all related topics.

Edit: Given your comments about both being in different processes, then you are best off sending information across a network (ie sockets programming). This would give you the added advantage of being able to run the main process and the debug process on different machines. It's a bit hard to give you much information on it. You'll need to figure out what sort of requests you will send across the network and what sort of data you will send back in response. Effectively you need to design your own simple protocol.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号