English 中文(简体)
System-V message-queue PHP C++
原标题:

I am wondering what are the limitation of System-V message queue i.e. Maximum queue size, maximum size per item etc.

As I am working on integration of C++ with my PHP scripts and have very large amount of data which will be pushed into queue from php and C++ process will read that data on the other end. I have devised an strategy in which i have 2 types of messages that will be written by php.

1) Message length
2) Message data

But, I am facing unpredictable behavior in my C++ application which is responsible of reading length/data sequence.

Firstly, I am unable to write more than 6000 Bytes per msg_send from php, thats why I had to break my message into chunks lead by the complete message size. so my queue will look something like this (msgtype in parentheses)

Size(1) + Chunk(2) + Chunk(2) + Chunk(2) + Size(1) + Size(1) + Chunk(2) + Chunk(2)

Though, I am able to read a few chunks correctly, but in the middle of somewhere I start getting receive error and leaving some messages in the queue and rendering the queue just useless.

问题回答

The limitations depend on your platform, OS version, and kernel parameters. You should consult documentation of your system. For example, you can get some info from msgctl() on Linux.





相关问题
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?

热门标签