@@ -302,6 +302,23 @@ public int MaxWireDocumentSize
302
302
}
303
303
}
304
304
305
+ /// <summary>
306
+ /// Gets the maximum size of the wire batch.
307
+ /// </summary>
308
+ /// <value>
309
+ /// The maximum size of the wire batch.
310
+ /// </value>
311
+ public int MaxWireBatchSize
312
+ {
313
+ get
314
+ {
315
+ lock ( _serverInstanceLock )
316
+ {
317
+ return _serverInfo . MaxWireBatchSize ;
318
+ }
319
+ }
320
+ }
321
+
305
322
/// <summary>
306
323
/// Gets the unique sequential Id for this server instance.
307
324
/// </summary>
@@ -703,6 +720,7 @@ private void LookupServerInformation(MongoConnection connection)
703
720
IsSecondary = false ,
704
721
MaxDocumentSize = currentServerInfo . MaxDocumentSize ,
705
722
MaxMessageLength = currentServerInfo . MaxMessageLength ,
723
+ MaxWireBatchSize = currentServerInfo . MaxWireBatchSize ,
706
724
ReplicaSetInformation = currentServerInfo . ReplicaSetInformation
707
725
} ;
708
726
@@ -860,6 +878,8 @@ private class ServerInformation
860
878
861
879
public int MaxWireDocumentSize { get { return MaxDocumentSize + 16 * 1024 ; } }
862
880
881
+ public int MaxWireBatchSize { get ; set ; }
882
+
863
883
public ReplicaSetInformation ReplicaSetInformation { get ; set ; }
864
884
865
885
public bool IsDifferentFrom ( ServerInformation other )
@@ -904,6 +924,11 @@ public bool IsDifferentFrom(ServerInformation other)
904
924
return true ;
905
925
}
906
926
927
+ if ( MaxWireBatchSize != other . MaxWireBatchSize )
928
+ {
929
+ return true ;
930
+ }
931
+
907
932
if ( ( ReplicaSetInformation == null && other . ReplicaSetInformation != null ) || ( ReplicaSetInformation != other . ReplicaSetInformation ) )
908
933
{
909
934
return true ;
0 commit comments