File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
src/BootstrapBlazor/Services/TcpSocket Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ sealed class DefaultTcpSocketClient(IPEndPoint localEndPoint) : ITcpSocketClient
2121
2222 public bool IsConnected => _client ? . Connected ?? false ;
2323
24- public IPEndPoint LocalEndPoint => localEndPoint ;
24+ public IPEndPoint ? LocalEndPoint { get ; set ; }
2525
2626 [ NotNull ]
2727 public ILogger < DefaultTcpSocketClient > ? Logger { get ; set ; }
@@ -237,10 +237,11 @@ private void Dispose(bool disposing)
237237 {
238238 if ( disposing )
239239 {
240+ LocalEndPoint = null ;
240241 _remoteEndPoint = null ;
241242
242243 // 取消接收数据的任务
243- if ( _receiveCancellationTokenSource is not null )
244+ if ( _receiveCancellationTokenSource != null )
244245 {
245246 _receiveCancellationTokenSource . Cancel ( ) ;
246247 _receiveCancellationTokenSource . Dispose ( ) ;
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ public interface ITcpSocketClient : IDisposable
5353 /// <remarks>This property provides information about the local endpoint of the socket, which is typically
5454 /// used to identify the local address and port being used for communication. If the socket is not bound to a
5555 /// specific local endpoint, this property may return <see langword="null"/>.</remarks>
56- IPEndPoint LocalEndPoint { get ; }
56+ IPEndPoint ? LocalEndPoint { get ; }
5757
5858 /// <summary>
5959 /// Gets or sets the callback function to handle received data.
You can’t perform that action at this time.
0 commit comments