@@ -46,7 +46,7 @@ public class MongoServerInstance
46
46
private MongoServerBuildInfo _buildInfo ;
47
47
private Exception _connectException ;
48
48
private MongoConnectionPool _connectionPool ;
49
- private IPEndPoint _endPoint ;
49
+ private IPEndPoint _ipEndPoint ;
50
50
private bool _isArbiter ;
51
51
private CommandResult _isMasterResult ;
52
52
private bool _isPassive ;
@@ -116,24 +116,6 @@ public MongoConnectionPool ConnectionPool
116
116
get { return _connectionPool ; }
117
117
}
118
118
119
- /// <summary>
120
- /// Gets the IP end point of this server instance.
121
- /// </summary>
122
- public IPEndPoint EndPoint
123
- {
124
- get {
125
- // use a lock free algorithm because DNS lookups are rare and concurrent lookups are tolerable
126
- // the intermediate variable is important to avoid race conditions
127
- var endPoint = _endPoint ;
128
- if ( endPoint == null )
129
- {
130
- endPoint = _address . ToIPEndPoint ( _server . Settings . AddressFamily ) ;
131
- _endPoint = endPoint ;
132
- }
133
- return endPoint ;
134
- }
135
- }
136
-
137
119
/// <summary>
138
120
/// Gets whether this server instance is an arbiter instance.
139
121
/// </summary>
@@ -215,6 +197,22 @@ public MongoServerState State
215
197
}
216
198
217
199
// public methods
200
+ /// <summary>
201
+ /// Gets the IP end point of this server instance.
202
+ /// </summary>
203
+ public IPEndPoint GetIPEndPoint ( )
204
+ {
205
+ // use a lock free algorithm because DNS lookups are rare and concurrent lookups are tolerable
206
+ // the intermediate variable is important to avoid race conditions
207
+ var ipEndPoint = _ipEndPoint ;
208
+ if ( ipEndPoint == null )
209
+ {
210
+ ipEndPoint = _address . ToIPEndPoint ( _server . Settings . AddressFamily ) ;
211
+ _ipEndPoint = ipEndPoint ;
212
+ }
213
+ return ipEndPoint ;
214
+ }
215
+
218
216
/// <summary>
219
217
/// Checks whether the server is alive (throws an exception if not).
220
218
/// </summary>
0 commit comments