Skip to content

Commit 939304e

Browse files
authored
Merge pull request #2652 from 01100010011001010110010101110000/v5-handle-null-insecure-tcp
Handle clusters with only secure tcp endpoints during reconnect
2 parents 18efa1b + 073047d commit 939304e

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/EventStore.ClientAPI/Messages/ClientMessagesExtensions.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ internal static partial class ClientMessage {
88
public partial class NotHandled {
99
public partial class MasterInfo {
1010
public IPEndPoint ExternalTcpEndPoint {
11-
get { return new IPEndPoint(IPAddress.Parse(ExternalTcpAddress), ExternalTcpPort); }
11+
get {
12+
return ExternalTcpAddress == null
13+
? null
14+
: new IPEndPoint(IPAddress.Parse(ExternalTcpAddress), ExternalTcpPort);
15+
}
1216
}
1317

1418
public IPEndPoint ExternalSecureTcpEndPoint {

src/EventStore.ClientAPI/SystemData/InspectionResult.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ internal class InspectionResult {
1111

1212
public InspectionResult(InspectionDecision decision, string description, IPEndPoint tcpEndPoint = null,
1313
IPEndPoint secureTcpEndPoint = null) {
14-
if (decision == InspectionDecision.Reconnect)
15-
Ensure.NotNull(tcpEndPoint, "tcpEndPoint");
14+
if (decision == InspectionDecision.Reconnect) {
15+
if (tcpEndPoint == null && secureTcpEndPoint == null) {
16+
throw new ArgumentException("tcpEndPoint and secureTcpEndPoint cannot both be null");
17+
}
18+
}
1619
else {
1720
if (tcpEndPoint != null)
1821
throw new ArgumentException(string.Format("tcpEndPoint is not null for decision {0}.", decision));

0 commit comments

Comments
 (0)