Hi,
I use boost::interprocess::file_mapping to map certain data files (data
files are on server). Then I use boost::interprocess::mapped_region with
that file-map to access the data. The following is pseudo code:
// file-map is initialized first
file_mapping fileMap(filename);
mapped_region mappedRegion(fileMap);
// later some where else data is read from file
float * ptr = reinterpret_cast(mappedRegion.get_address());
float value = ptr[index];
This works normally fine. But sometimes you map data file when network is ok
After that you need to look some data (in portion that is not on memory
allready) when the network is not in use, then program just crashes. This is
pretty logical to me. But the question is, can I some how detect the problem
and prevent the crash. I tried to catch exception but no help there.
And is this the rigth way to use mapped files?
Marko