public override void Flush()
 {
     if (RecordStream != null)
     {
         RecordStream.Flush();
     }
 }
Пример #2
0
 public void Flush()
 {
     if (Writer != null)
     {
         Writer.Flush();
     }
     if (RecordStream != null)
     {
         RecordStream.Flush();
     }
 }
        public override int Read(byte[] buffer, int offset, int count)
        {
            int bytesRead = InputStream.Read(buffer, offset, count);

            if (RecordStream != null)
            {
                RecordStream.Write(buffer, offset, bytesRead);
                RecordStream.Flush();
            }
            return(bytesRead);
        }
Пример #4
0
        private void ProcessSendFatalAlert(Alert alert)
        {
            try {
                // Create and encrypt the alert record
                Record record = new Record(RecordType.Alert, _handshakeSession.NegotiatedVersion, alert.GetBytes());
                _recordHandler.ProcessOutputRecord(record);

                // Attempt sending the alert record
                _recordStream.Send(new Record[] { record });
                _recordStream.Flush();
                _recordStream.Close();
            } catch (Exception) {}
        }
Пример #5
0
        public int AddOrGet(string tag)
        {
            int key;

            lock (_lock)
                if (!_tags.TryGetValue(tag, out key))
                {
                    var id = NextTagId();
                    _tags.Add(tag, key = id);
                    _strings.Add(id, tag);
                    _file.Write(new TagStorageClass {
                        Tag = tag
                    });
                    _file.Flush();
                }

            return(key);
        }
Пример #6
0
        public int AddOrGet(IEnumerable <int> tagsIn)
        {
            var tags = tagsIn.ToArray();

            lock (_lock)
            {
                int id;
                var item = _paths.FirstOrDefault(p => StructuralComparisons.StructuralEqualityComparer.Equals(p.Key, tags));
                if (item.Key == null)
                {
                    id              = GetNextPathId();
                    _paths[tags]    = id;
                    _pathLookup[id] = tags;
                    _file.Write(new PathStorageClass {
                        Tags = tags
                    });
                    _file.Flush();
                    return(id);
                }
                return(item.Value);
            }
        }
Пример #7
0
 protected internal virtual void Flush()
 {
     mRecordStream.Flush();
 }