I have 3 choices to use : sockets, activeX, com , in order to communicate between applications on one computer. Which is faster ?
相关问题
- Sorting 3 numbers without branching [closed]
- Multiple sockets for clients to connect to
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- thread_local variables initialization
相关文章
- 如何让cmd.exe 执行 UNICODE 文本格式的批处理?
- 怎么把Windows开机按钮通过修改注册表指向我自己的程序
- Warning : HTML 1300 Navigation occured?
- Class layout in C++: Why are members sometimes ord
- How to mock methods return object with deleted cop
- Which is the best way to multiply a large and spar
- C++ default constructor does not initialize pointe
- Selecting only the first few characters in a strin
It's hard to say which is faster, but using COM is certainly the most flexible of the choices you listed. Unless you like grovelling through byte streams.
Well, think about it - socket is the lowest level, COM is using sockets, ActiveX is using COM. So which one is faster? Of course, sockets. But that is only if you are asking about program execution speed and data transfer rates. Developing programs using sockets, however, can be much harder if you don't know what you are doing. Not to mention that you possibly can come up with some bad implementation that will be worse than COM. Also, there are not that much of reusable components you can get for sockets as you get using ActiveX, not to mention that if you want to communicate with MS Office, you will have to use COM.
You don't give much detail about what you're trying to do or what considerations you need to make. For example, by "fast" do you mean high bandwidth? Low latency? Is there a possibility you might need to communicate across computers later? Etc.
That said, ActiveX is a special case of COM (introduction to activeX). If you're familiar with COM or ActiveX already, and depending on what exactly you're trying to do, you may be able to get away with writing relatively little code because MS dev tools can handle a lot of it for you.
If you're not familiar with it though, it's a fairly complex technology that may be tricky to wrap your head around. So if you're just trying to implement some basic inter-process communication it may be easier to go with sockets. On the other hand, that may require more low level work on your part.
Hi can you use shared memory? Even Oracle use shared memory in their products. Shared memory is fast.
I would also delegate the IPC to a framework e.g. ACE (adaptive communication framework). Ace's implementation for example, is stable and it's cross platform.
ActiveX is more or less a fancy marketing name on COM (an ActiveX component / control is an object that just supports the IUnknown interface), so your choice is really down to COM vs Socket.
For cross process communication, you can write something faster with sockets... if you're a good socket and Windows programmer, because you will be on your own, as Sockets will basically do nothing to help you. That does not mean COM is not fast, or has bad performance, but you always theoretically can do better than an out-of-the-box system, but only if you master the whole thing.
On last thing, if you need to communicate with 3rd party products or other platforms than Windows, Sockets are more portable.