示例#1
0
        public ChoMemoryMappedFileReader(string name, ChoMsgFormatter msgFormatter = ChoMsgFormatter.Binary)
        {
            ChoGuard.ArgumentNotNullOrEmpty(name, "Name");

            _name         = name;
            _msgFormatter = msgFormatter;
            mf            = MemoryMappedFile.OpenExisting(_name, MemoryMappedFileRights.Read);
            _event        = new EventWaitHandle(false, EventResetMode.AutoReset, ChoMutexHelper.GetName(_name));
        }
        public ChoMemoryMappedFileWriter(string name, ChoMsgFormatter msgFormatter = ChoMsgFormatter.Binary)
        {
            ChoGuard.ArgumentNotNullOrEmpty(name, "Name");

            _name         = name;
            _msgFormatter = msgFormatter;

            mf     = MemoryMappedFile.CreateOrOpen(_name, 4096, MemoryMappedFileAccess.ReadWrite);
            _event = new EventWaitHandle(true, EventResetMode.AutoReset, ChoMutexHelper.GetName(_name));
        }