Hi Ion
Thanks a lot Ion, you saved my day. Let me try this out tomorrow. Was stuck with this for a week.
regards
Achuth
El 04/05/2012 23:47, Achuth Sankar escribiķ:when "mapped_region" is destroyed, then the shared memory is unmapped and you have no acces to it. Make mapped_region a member of your class.
Hi All
Am facing a lot of issue while using interprocess features inside
my class file. I am pasting my class file below:
//Assign the recently created mapped region to the internal member
void MyClass::createBuffer() {
shared_memory_object::remove("test");
shared_memory_object shm(open_or_create, infoBufferName, read_write);
shm.truncate(sizeof(ServerDetails));
mapped_region region(shm, read_write);
void* addr = region.get_address();
ref=new (addr) Ref;
ref->value=50;
m_member_mapped_region = boost::move(region);
}
best,
Ion
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users