Source/Providers/NFX.MongoDB/Connector/Protocol.cs
/// <summary>
/// Reads OP_REPLY but does not interpret it
/// </summary>
Reads OP_REPLY but does not interpret it
Reads OP_REPLY but does not interpret it
public static ReplyData Read_REPLY(Stream stream)
                        {
                           stream.Position = sizeof(Int32);
                           var hdrReqID  = BinUtils.ReadInt32(stream);
                           var hdrRespTo = BinUtils.ReadInt32(stream);
                           var hdrOpCode = BinUtils.ReadInt32(stream);
                           if (hdrOpCode!=OP_REPLY)
                             throw new MongoDBConnectorProtocolException(StringConsts.PROTO_READ_OP_REPLY_ERROR+" not OP_REPLY");
                           var flags = (ResponseFlags)BinUtils.ReadInt32(stream);
                           var cursorID = BinUtils.ReadInt64(stream);
                           var startingFrom = BinUtils.ReadInt32(stream);
                           var numReturned = BinUtils.ReadInt32(stream);
                           if (numReturned>MAX_DOC_COUNT_LIMIT)
                             throw new MongoDBConnectorProtocolException(StringConsts.PROTO_REPLY_DOC_COUNT_EXCEED_LIMIT_ERROR.Args(numReturned, MAX_DOC_COUNT_LIMIT));
                           var docs = new BSONDocument[numReturned];
                           for(var i=0; i < numReturned; i++)
                             docs[i] = new BSONDocument(stream);
                           return new ReplyData(hdrReqID, hdrRespTo, flags, cursorID, startingFrom, docs);
                        }
public static ReplyData Read_REPLY ( Stream stream ) { stream . Position = sizeof ( Int32 ) ; var hdrReqID = BinUtils . ReadInt32 ( stream ) ; var hdrRespTo = BinUtils . ReadInt32 ( stream ) ; var hdrOpCode = BinUtils . ReadInt32 ( stream ) ; if ( hdrOpCode != OP_REPLY ) throw new MongoDBConnectorProtocolException ( StringConsts . PROTO_READ_OP_REPLY_ERROR + " " ) ; var flags = ( ResponseFlags ) BinUtils . ReadInt32 ( stream ) ; var cursorID = BinUtils . ReadInt64 ( stream ) ; var startingFrom = BinUtils . ReadInt32 ( stream ) ; var numReturned = BinUtils . ReadInt32 ( stream ) ; if ( numReturned > MAX_DOC_COUNT_LIMIT ) throw new MongoDBConnectorProtocolException ( StringConsts . PROTO_REPLY_DOC_COUNT_EXCEED_LIMIT_ERROR . Args ( numReturned , MAX_DOC_COUNT_LIMIT ) ) ; var docs = new BSONDocument [ numReturned ] ; for ( var i = 0 ; i < numReturned ; i ++ ) docs [ i ] = new BSONDocument ( stream ) ; return new ReplyData ( hdrReqID , hdrRespTo , flags , cursorID , startingFrom , docs ) ; }
Reads OP_REPLY but does not interpret it
Reads OP_REPLY but does not interpret it
//skip Total size
stream
Stream