Mono.FastCgi.Connection.SendRecord C# (CSharp) Method

SendRecord() public method

public SendRecord ( RecordType type, ushort requestID, byte bodyData ) : void
type RecordType
requestID ushort
bodyData byte
return void
        public void SendRecord(RecordType type, ushort requestID,
		                        byte [] bodyData)
        {
            SendRecord (type, requestID, bodyData, 0, -1);
        }

Same methods

Connection::SendRecord ( RecordType type, ushort requestID, byte bodyData, int bodyIndex, int bodyLength ) : void

Usage Example

コード例 #1
0
        void SendStreamData(RecordType type, byte [] data,
                            int length)
        {
            // Records are only able to hold 65535 bytes of data. If
            // larger data is to be sent, it must be broken into
            // smaller components.

            if (length > data.Length)
            {
                length = data.Length;
            }

            const int maxSize = 0x7fff;

            if (length < maxSize)
            {
                connection.SendRecord(type, RequestID, data, 0,
                                      length);
            }
            else
            {
                int index = 0;
                while (index < length)
                {
                    int chunkLength = (maxSize <
                                       length - index) ? maxSize :
                                      (length - index);

                    connection.SendRecord(type, RequestID,
                                          data, index, chunkLength);

                    index += chunkLength;
                }
            }
        }