Example #1
0
 public override void WriteEndOfMessage()
 {
     if (this.disposed)
     {
         throw new ObjectDisposedException(null);
     }
     if (TcpStream.TRACESWITCH.TraceVerbose)
     {
         StackTrace stackTrace = new StackTrace();
         stackTrace.GetFrame(1).GetMethod();
     }
     try
     {
         if (this.dimeWriter == null)
         {
             throw new InvalidOperationException();
         }
         this.dimeWriter.Close();
         this.dimeWriter  = null;
         this.endOfStream = false;
     }
     catch (XmlaStreamException)
     {
         throw;
     }
     catch (IOException innerException)
     {
         throw new XmlaStreamException(innerException);
     }
     catch (SocketException innerException2)
     {
         throw new XmlaStreamException(innerException2);
     }
 }
Example #2
0
 public override void Write(byte[] buffer, int offset, int size)
 {
     if (this.disposed)
     {
         throw new ObjectDisposedException(null);
     }
     if (buffer == null)
     {
         throw new ArgumentNullException("buffer");
     }
     if (offset < 0)
     {
         throw new ArgumentOutOfRangeException("offset");
     }
     if (size < 0)
     {
         throw new ArgumentOutOfRangeException("size");
     }
     if (size + offset > buffer.Length)
     {
         throw new ArgumentException(XmlaSR.InvalidArgument, "buffer");
     }
     try
     {
         if (size > 0)
         {
             if (this.dimeWriter == null)
             {
                 this.dimeWriter = new DimeWriter(this.bufferedStream);
                 this.dimeWriter.DefaultChunkSize = this.dimeChunkSize;
                 this.dimeWriter.Options          = base.GetTransportCapabilities();
                 this.dimeRecordForWrite          = this.dimeWriter.CreateRecord(null, DataTypes.GetDataTypeFromEnum(this.GetRequestDataType()), TypeFormatEnum.MediaType, -1);
                 if (TcpStream.TRACESWITCH.TraceVerbose)
                 {
                     StackTrace stackTrace = new StackTrace();
                     stackTrace.GetFrame(1).GetMethod();
                 }
             }
             this.dimeRecordForWrite.WriteBody(buffer, offset, size);
         }
     }
     catch (XmlaStreamException)
     {
         throw;
     }
     catch (IOException innerException)
     {
         throw new XmlaStreamException(innerException);
     }
     catch (SocketException innerException2)
     {
         throw new XmlaStreamException(innerException2);
     }
 }