Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesNK committed Nov 8, 2021
1 parent f4eb58c commit 17405aa
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ internal class SocketConnectivitySubchannelTransport : ISubchannelTransport, IDi
private Socket? _initialSocket;
private DnsEndPoint? _initialSocketEndPoint;
private bool _disposed;
private BalancerAddress? _currentEndPoint;
private BalancerAddress? _currentAddress;

public SocketConnectivitySubchannelTransport(Subchannel subchannel, TimeSpan socketPingInterval, ILoggerFactory loggerFactory)
{
Expand All @@ -71,7 +71,7 @@ public SocketConnectivitySubchannelTransport(Subchannel subchannel, TimeSpan soc
}

public object Lock => _subchannel.Lock;
public BalancerAddress? CurrentAddress => _currentEndPoint;
public BalancerAddress? CurrentAddress => _currentAddress;
public bool HasStream { get; }

// For testing. Take a copy under lock for thread-safety.
Expand All @@ -92,7 +92,7 @@ public void Disconnect()
_initialSocketEndPoint = null;
_lastEndPointIndex = 0;
_socketConnectedTimer.Change(TimeSpan.Zero, TimeSpan.Zero);
_currentEndPoint = null;
_currentAddress = null;
}
_subchannel.UpdateConnectivityState(ConnectivityState.Idle, "Disconnected.");
}
Expand Down Expand Up @@ -125,7 +125,7 @@ public async ValueTask<bool> TryConnectAsync(CancellationToken cancellationToken

lock (Lock)
{
_currentEndPoint = currentAddress;
_currentAddress = currentAddress;
_lastEndPointIndex = currentIndex;
_initialSocket = socket;
_initialSocketEndPoint = currentAddress.EndPoint;
Expand Down Expand Up @@ -196,7 +196,7 @@ private async void OnCheckSocketConnection(object? state)
_initialSocket.Dispose();
_initialSocket = null;
_initialSocketEndPoint = null;
_currentEndPoint = null;
_currentAddress = null;
_lastEndPointIndex = 0;
}
}
Expand Down

0 comments on commit 17405aa

Please sign in to comment.