Table of Contents

Class MongoServerInstance

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.Legacy.dll

Represents an instance of a MongoDB server host.

public sealed class MongoServerInstance
Inheritance
MongoServerInstance
Inherited Members
Extension Methods

Properties

Address

Gets the address of this server instance.

public MongoServerAddress Address { get; }

Property Value

MongoServerAddress

InstanceType

Gets the instance type.

public MongoServerInstanceType InstanceType { get; }

Property Value

MongoServerInstanceType

IsArbiter

Gets a value indicating whether this server instance is an arbiter instance.

public bool IsArbiter { get; }

Property Value

bool

IsPassive

Gets a value indicating whether this server instance is a passive instance.

[Obsolete("Passives are treated the same as secondaries.")]
public bool IsPassive { get; }

Property Value

bool

IsPrimary

Gets a value indicating whether this server instance is a primary.

public bool IsPrimary { get; }

Property Value

bool

IsSecondary

Gets a value indicating whether this server instance is a secondary.

public bool IsSecondary { get; }

Property Value

bool

MaxBatchCount

Gets the maximum batch count for write operations.

public int MaxBatchCount { get; }

Property Value

int

MaxDocumentSize

Gets the max document size for this server instance.

public int MaxDocumentSize { get; }

Property Value

int

MaxMessageLength

Gets the max message length for this server instance.

public int MaxMessageLength { get; }

Property Value

int

MaxWireDocumentSize

Gets the maximum size of a wire document. Normally slightly larger than MaxDocumentSize.

public int MaxWireDocumentSize { get; }

Property Value

int

MaxWireVersion

Gets the maximum wire version.

public int MaxWireVersion { get; }

Property Value

int

SequentialId

Gets the unique sequential Id for this server instance.

public int SequentialId { get; }

Property Value

int

Settings

Gets the server for this server instance.

public MongoServerSettings Settings { get; }

Property Value

MongoServerSettings

State

Gets the state of this server instance.

public MongoServerState State { get; }

Property Value

MongoServerState

Methods

GetIPEndPoint()

Gets the IP end point of this server instance.

public IPEndPoint GetIPEndPoint()

Returns

IPEndPoint

The IP end point of this server instance.

GetServerDescription()

Gets the server description.

public ServerDescription GetServerDescription()

Returns

ServerDescription

The server description.

Ping()

Checks whether the server is alive (throws an exception if not).

public void Ping()

Supports(FeatureId)

Checks whether this server instance supports a feature.

public bool Supports(FeatureId featureId)

Parameters

featureId FeatureId

The id of the feature.

Returns

bool

True if this server instance supports the feature; otherwise, false.

Events

StateChanged

Occurs when the value of the State property changes.

public event EventHandler StateChanged

Event Type

EventHandler