Ejemplo n.º 1
0
 public Stream GetStream()
 {
     if (_stream == null)
     {
         Stream stream = GetInternalStream();
         ConnectionMonitorStream mstream = new ConnectionMonitorStream(stream);
         mstream.AttachStats(GlobalStats);
         mstream.AttachStats(LocalStats);
         _stream = new ThrottleStream(mstream, _throttleSpeed);
         if (_hookStream != null)
         {
             _hookStream.Hook(_stream);
         }
     }
     if (_hookStream != null)
     {
         return(_hookStream);
     }
     return(_stream);
 }
Ejemplo n.º 2
0
		public Stream GetStream() {
			if (_stream == null) {
				Stream stream = GetInternalStream();
				ConnectionMonitorStream mstream = new ConnectionMonitorStream(stream);
				mstream.AttachStats(GlobalStats);
				mstream.AttachStats(LocalStats);
				_stream = new ThrottleStream(mstream, _throttleSpeed);
				if (_hookStream != null)
					_hookStream.Hook(_stream);
			}
			if (_hookStream != null)
				return _hookStream;
			return _stream;
		}