Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add ResponseFlags.

  • Loading branch information...
commit 725088f093fd3c8751863ab6b01ad49b6301121b 1 parent e1305e6
@lanwin lanwin authored
View
1  source/MongoDB/MongoDB.csproj
@@ -144,6 +144,7 @@
<Compile Include="MapReduce.cs" />
<Compile Include="Commands\MapReduceCommand.cs" />
<Compile Include="MongoRegexOption.cs" />
+ <Compile Include="Protocol\ResponseFlags.cs" />
<Compile Include="Results\MapReduceResult.cs" />
<Compile Include="Serialization\Builders\DictionaryBuilder.cs" />
<Compile Include="Serialization\Builders\PropertyDescriptor.cs" />
View
4 source/MongoDB/Protocol/ReplyMessage.cs
@@ -37,7 +37,7 @@ internal class ReplyMessage<T> : MessageBase where T : class
/// normally zero, non-zero on query failure
/// </summary>
/// <value>The response flag.</value>
- public int ResponseFlag { get; set; }
+ public ResponseFlags ResponseFlag { get; set; }
/// <summary>
/// id of the cursor created for this query response
@@ -71,7 +71,7 @@ internal class ReplyMessage<T> : MessageBase where T : class
stream = new BufferedStream(stream, 256);
var reader = new BinaryReader(stream);
Header = ReadHeader(reader);
- ResponseFlag = reader.ReadInt32();
+ ResponseFlag = (ResponseFlags)reader.ReadInt32();
CursorId = reader.ReadInt64();
StartingFrom = reader.ReadInt32();
NumberReturned = reader.ReadInt32();
View
35 source/MongoDB/Protocol/ResponseFlags.cs
@@ -0,0 +1,35 @@
+using System;
+
+namespace MongoDB.Protocol
+{
+ /// <summary>
+ /// Server response flags
+ /// </summary>
+ /// <remarks>
+ /// ShardConfigStale = 4 is ignored because its Mongo internal.
+ /// </remarks>
+ [Flags]
+ internal enum ResponseFlags
+ {
+ /// <summary>
+ /// </summary>
+ None = 0,
+ /// <summary>
+ /// Set when getMore is called but the cursor id is not valid at
+ /// the server. Returned with zero results.
+ /// </summary>
+ CursorNotFound = 1,
+ /// <summary>
+ /// Set when query failed. Results consist of one document containing
+ /// an "$err" field describing the failure.
+ /// </summary>
+ QueryFailure = 2,
+ /// <summary>
+ /// Set when the server supports the AwaitData Query option. If it
+ /// doesn't, a client should sleep a little between getMore's of a
+ /// Tailable cursor. Mongod version 1.6 supports AwaitData and
+ /// thus always sets AwaitCapable.
+ /// </summary>
+ AwaitCapable = 8
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.