English 中文(简体)
从一个进程向另一个进程转移结构的最佳方式?
原标题:Best way to transfer struct from one process to another?

我有一个服务器系统和一些客户,客户需要尽可能多地向服务器发送服务机,他们不会等待任何答案,只是寄送和发送。 在这种情形下,我可以采取什么方式转移下一步工作:

typedef struct tagTDATA {
         BYTE c1;
         DWORD dw1;
         DWORD dw2;
         char ch[255];
} TDATA, *PTDATA;

Cant use Boost。 其最佳方式是Win AP。 而不需要法律解决办法,只是给我指明正确的方向。 感谢。

最佳回答

就像你正在寻求一个同步的PC机制一样。 可能最容易做到这一点。 管道是另一个明显的选择,现有许多更高层次的图书馆,但我认为书状像最佳版本一样健全。

问题回答

Are the server and clients on different hosts? If so, why don t you take UDP and to methods to serialize your structure to send via network and the second one to get it back to structure? ...

WM_COPYDATA,专门用于在各进程之间转让建筑。 检查结果。

不过,你提到的是——而且不是——你不能期望各进程之间的工作。 如果你有可变的阵列或点数,则可能有必要将数据序列化,例如与BSON或XML。

阅读和写作 记忆应该能够为你们做trick。





相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签