示例#1
0
            protected override Stream openStream()
            {
                try
                {
                    String         url  = wire.url + "?serverId=" + TargetId.getServerId() + "&messageid=" + TargetId.getMessageId() + "&streamid=" + TargetId.getStreamId();
                    HttpWebRequest conn = (HttpWebRequest)HttpWebRequest.Create(url);
                    request = wire.createRequestForGetStream(TargetId, this);
                    request.setConnection(conn);

                    conn.Method = "GET";
                    wire.applySession(conn);

                    response           = (HttpWebResponse)conn.GetResponse();
                    ContentType        = response.ContentType;
                    ContentLength      = response.ContentLength;
                    ContentDisposition = response.Headers["Content-Disposition"];

                    responseStream = response.GetResponseStream();
                }
                catch (Exception ex)
                {
                    BException bex = new BException(BExceptionC.IOERROR, "", ex);
                    setAsyncResult(null, bex);
                    wire.removeRequest(request, null, bex);
                }

                throwExceptionIf();

                return(responseStream);
            }