Class RequestMessage
- Namespace
- MongoDB.Driver.Core.WireProtocol.Messages
- Assembly
- MongoDB.Driver.Core.dll
Represents a base class for request messages.
public abstract class RequestMessage : MongoDBMessage, IEncodableMessage
- Inheritance
-
RequestMessage
- Implements
- Derived
- Inherited Members
Constructors
RequestMessage(int, Func<bool>)
Initializes a new instance of the RequestMessage class.
protected RequestMessage(int requestId, Func<bool> shouldBeSent = null)
Parameters
requestId
intThe request identifier.
shouldBeSent
Func<bool>A delegate that determines whether this message should be sent.
Properties
CurrentGlobalRequestId
Gets the current global request identifier.
public static int CurrentGlobalRequestId { get; }
Property Value
- int
The current global request identifier.
RequestId
Gets the request identifier.
public int RequestId { get; }
Property Value
- int
The request identifier.
ShouldBeSent
Gets a delegate that determines whether this message should be sent.
public Func<bool> ShouldBeSent { get; }
Property Value
WasSent
Gets or sets a value indicating whether this message was sent.
public bool WasSent { get; set; }
Property Value
- bool
true
if this message was sent; otherwise,false
.
Methods
GetNextRequestId()
Gets the next request identifier.
public static int GetNextRequestId()
Returns
- int
The next request identifier.