File tree Expand file tree Collapse file tree
src/extensions/BootstrapBlazor.TcpSocket Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33// Website: https://www.blazor.zone or https://argozhang.github.io/
44
5+ using BootstrapBlazor . Components ;
6+ using Microsoft . Extensions . DependencyInjection ;
7+ using Microsoft . Extensions . Logging ;
58using System . Collections . Concurrent ;
69using System . Runtime . Versioning ;
710
@@ -14,6 +17,14 @@ sealed class DefaultTcpSocketFactory(IServiceProvider provider) : ITcpSocketFact
1417
1518 public ITcpSocketClient GetOrCreate ( string name , Action < TcpSocketClientOptions > valueFactory )
1619 {
20+ if ( ! SocketLogging . Inited )
21+ {
22+ var logger = provider . GetService < ILogger < DefaultTcpSocketFactory > > ( ) ;
23+ if ( logger != null )
24+ {
25+ SocketLogging . Init ( logger ) ;
26+ }
27+ }
1728 return _pool . GetOrAdd ( name , key =>
1829 {
1930 var options = new TcpSocketClientOptions ( ) ;
You can’t perform that action at this time.
0 commit comments