@@ -46,7 +46,7 @@ public class MongoServerInstance
4646 private MongoServerBuildInfo _buildInfo ;
4747 private Exception _connectException ;
4848 private MongoConnectionPool _connectionPool ;
49- private IPEndPoint _endPoint ;
49+ private IPEndPoint _ipEndPoint ;
5050 private bool _isArbiter ;
5151 private CommandResult _isMasterResult ;
5252 private bool _isPassive ;
@@ -116,24 +116,6 @@ public MongoConnectionPool ConnectionPool
116116 get { return _connectionPool ; }
117117 }
118118
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-
137119 /// <summary>
138120 /// Gets whether this server instance is an arbiter instance.
139121 /// </summary>
@@ -215,6 +197,22 @@ public MongoServerState State
215197 }
216198
217199 // 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+
218216 /// <summary>
219217 /// Checks whether the server is alive (throws an exception if not).
220218 /// </summary>
0 commit comments