コード例 #1
0
        private void EndGetResponseCallback(IAsyncResult ar)
        {
            try
            {
                this.m_response = this.m_request.EndGetResponse(ar);
                this.m_context.Response.ContentType = this.m_response.ContentType;

                var streamIn = this.m_response.GetResponseStream();
                var streamOut = this.m_context.Response.OutputStream;

                var transfer = new AsyncTransfer(streamIn, streamOut);
                transfer.Completed += (sender, args) => this.OnCompleted(args.Error);
                transfer.StartAsync();
            }
            catch(Exception ex)
            {
                this.OnCompleted(ex);
            }
        }
コード例 #2
0
ファイル: AsyncWebTransfer.cs プロジェクト: Vlongcom/samples
        private void EndGetResponseCallback(IAsyncResult ar)
        {
            try
            {
                this.m_response = this.m_request.EndGetResponse(ar);
                this.m_context.Response.ContentType = this.m_response.ContentType;

                var streamIn  = this.m_response.GetResponseStream();
                var streamOut = this.m_context.Response.OutputStream;

                var transfer = new AsyncTransfer(streamIn, streamOut);
                transfer.Completed += (sender, args) => this.OnCompleted(args.Error);
                transfer.StartAsync();
            }
            catch (Exception ex)
            {
                this.OnCompleted(ex);
            }
        }