Exemplo n.º 1
0
 protected virtual void OnRequest(XmlRpcRequestEventArgs e)
 {
     if (RequestEvent != null)
     {
         RequestEvent(this, e);
     }
 }
		protected override async void OnRequest(object sender, XmlRpcRequestEventArgs e)
		{
			string fname = string.Format("{0}/{1}-{2:0000}-request-{3}.xml",
			  _directory, DateTime.Now.Ticks, e.RequestNum, e.ProxyID);

			var file = await Directory.CreateFileAsync(fname, CreationCollisionOption.ReplaceExisting);
			using (var str = await file.OpenAsync(FileAccessMode.ReadWrite))
			{
				using (var dw = new DataWriter(str))
				{
					await e.RequestStream.CopyToAsync(str.AsStreamForWrite());
					await dw.FlushAsync();
					dw.DetachStream();
				}
			}

		}
        protected override async void OnRequest(object sender, XmlRpcRequestEventArgs e)
        {
            string fname = string.Format("{0}/{1}-{2:0000}-request-{3}.xml",
                                         _directory, DateTime.Now.Ticks, e.RequestNum, e.ProxyID);

            var file = await Directory.CreateFileAsync(fname, CreationCollisionOption.ReplaceExisting);

            using (var str = await file.OpenAsync(FileAccessMode.ReadWrite))
            {
                using (var dw = new DataWriter(str))
                {
                    await e.RequestStream.CopyToAsync(str.AsStreamForWrite());

                    await dw.FlushAsync();

                    dw.DetachStream();
                }
            }
        }
Exemplo n.º 4
0
 protected virtual void OnRequest(object sender, XmlRpcRequestEventArgs e)
 {
 }
Exemplo n.º 5
0
 protected virtual void OnRequest(object sender, XmlRpcRequestEventArgs e)
 {
 }