Class CommandMessage
- Namespace
- MongoDB.Driver.Core.WireProtocol.Messages
- Assembly
- MongoDB.Driver.Core.dll
Represents a command message.
public sealed class CommandMessage : MongoDBMessage, IEncodableMessage
- Inheritance
-
CommandMessage
- Implements
- Inherited Members
Constructors
CommandMessage(int, int, IEnumerable<CommandMessageSection>, bool)
Initializes a new instance of the CommandMessage class.
public CommandMessage(int requestId, int responseTo, IEnumerable<CommandMessageSection> sections, bool moreToCome)
Parameters
requestId
intThe request identifier.
responseTo
intThe response to.
sections
IEnumerable<CommandMessageSection>The sections.
moreToCome
boolif set to
true
[more to come].
- See Also
Properties
ExhaustAllowed
Gets or sets a value indicating whether multiple responses might be returned from the server or not.
public bool ExhaustAllowed { get; set; }
Property Value
- bool
true
if the server might return multiple responses; otherwise,false
.
- See Also
MayBeCompressed
Gets the flag whether the message may be compressed or not.
public override bool MayBeCompressed { get; }
Property Value
- See Also
MessageType
Gets the type of the message.
public override MongoDBMessageType MessageType { get; }
Property Value
- See Also
MoreToCome
Gets or sets a value indicating whether another message immediately follows this one with no response expected.
public bool MoreToCome { get; set; }
Property Value
- bool
true
if another message immediately follows this one; otherwise,false
.
- See Also
PostWriteAction
Gets or sets the delegate called to after the message has been written by the encoder.
public Action<IMessageEncoderPostProcessor> PostWriteAction { get; set; }
Property Value
- Action<IMessageEncoderPostProcessor>
The post write delegate.
- See Also
RequestId
Gets the request identifier.
public int RequestId { get; }
Property Value
- int
The request identifier.
- See Also
ResponseExpected
Gets a value indicating whether a response is expected.
public bool ResponseExpected { get; }
Property Value
- bool
true
if a response is expected; otherwise,false
.
- See Also
ResponseTo
Gets the response to.
public int ResponseTo { get; }
Property Value
- int
The response to.
- See Also
Sections
Gets the sections.
public IReadOnlyList<CommandMessageSection> Sections { get; }
Property Value
- IReadOnlyList<CommandMessageSection>
The sections.
- See Also
Methods
GetEncoder(IMessageEncoderFactory)
Gets an encoder for the message from an encoder factory.
public override IMessageEncoder GetEncoder(IMessageEncoderFactory encoderFactory)
Parameters
encoderFactory
IMessageEncoderFactoryThe encoder factory.
Returns
- IMessageEncoder
A message encoder.
- See Also