Microsoft.SqlServer.TDS.TDSStream.EndMessage C# (CSharp) Method

EndMessage() public method

Send the last packet of the message and complete the request/response
public EndMessage ( ) : void
return void
        public virtual void EndMessage()
        {
            // Check if we have a current packet
            if (OutgoingPacketHeader != null)
            {
                // Indicate that this is the end of message
                OutgoingPacketHeader.Status |= TDSPacketStatus.EndOfMessage;

                // Send the packet out
                _SendCurrentPacket();
            }
        }

Usage Example

示例#1
0
        /// <summary>
        /// Protocol-aware deflation routine
        /// </summary>
        /// <param name="stream">Destination to deflate the message</param>
        public void Deflate(TDSStream stream)
        {
            // Start a message on the stream
            stream.StartMessage(MessageType);

            // Iterate through each token and deflate it
            foreach (TDSPacketToken token in this)
            {
                // Deflate token into the data stream
                token.Deflate(stream);
            }

            // Complete the message
            stream.EndMessage();
        }