33// See the LICENSE file in the project root for more information.
44// Maintainer: Argo Zhang([email protected] ) Website: https://www.blazor.zone 55
6+ using System . Net ;
7+
68namespace BootstrapBlazor . Components ;
79
810/// <summary>
@@ -11,21 +13,21 @@ namespace BootstrapBlazor.Components;
1113public interface ITcpSocketFactory : IDisposable
1214{
1315 /// <summary>
14- /// Retrieves an existing TCP socket associated with the specified host and port, or creates a new one if none
15- /// exists.
16+ /// Retrieves an existing TCP socket client by name or creates a new one if it does not exist.
1617 /// </summary>
17- /// <param name="host">The hostname or IP address of the remote endpoint. Cannot be null or empty.</param>
18- /// <param name="port">The port number of the remote endpoint. Must be a valid port number between 0 and 65535.</param>
19- /// <returns>An <see cref="ITcpSocketClient"/> instance representing the TCP socket for the specified host and port.</returns>
20- ITcpSocketClient GetOrCreate ( string host , int port ) ;
18+ /// <param name="name">The unique name used to identify the TCP socket client. Cannot be null or empty.</param>
19+ /// <param name="endPoint">The network endpoint to associate with the TCP socket client. Must be a valid <see
20+ /// cref="System.Net.IPEndPoint"/> instance.</param>
21+ /// <returns>An instance of <see cref="ITcpSocketClient"/> representing the TCP socket client associated with the specified
22+ /// name and endpoint. If a client with the given name already exists, the existing instance is returned; otherwise,
23+ /// a new client is created.</returns>
24+ ITcpSocketClient GetOrCreate ( string name , IPEndPoint endPoint ) ;
2125
2226 /// <summary>
23- /// Removes the specified host and port combination from the collection .
27+ /// Removes the TCP socket client associated with the specified name .
2428 /// </summary>
25- /// <remarks>If the specified host and port combination does not exist in the collection, the method has
26- /// no effect.</remarks>
27- /// <param name="host">The hostname to remove. Cannot be null or empty.</param>
28- /// <param name="port">The port number associated with the host to remove. Must be a valid port number (0-65535).</param>
29- /// <returns>An <see cref="ITcpSocketClient"/> instance representing the TCP socket for the specified host and port.</returns>
30- ITcpSocketClient ? Remove ( string host , int port ) ;
29+ /// <param name="name">The name of the TCP socket client to remove. Cannot be <see langword="null"/> or empty.</param>
30+ /// <returns>The removed <see cref="ITcpSocketClient"/> instance if a client with the specified name exists; otherwise, <see
31+ /// langword="null"/>.</returns>
32+ ITcpSocketClient ? Remove ( string name ) ;
3133}
0 commit comments