tgstation-server
6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
src
Tgstation.Server.Host
Components
Session
TopicClientFactory.cs
Go to the documentation of this file.
1
using
System;
2
3
using
Byond.TopicSender;
4
5
using
Microsoft.Extensions.Logging;
6
7
namespace
Tgstation.Server.Host.Components.Session
8
{
10
sealed
class
TopicClientFactory
:
ITopicClientFactory
11
{
15
readonly ILogger<TopicClient>?
logger
;
16
21
public
TopicClientFactory
(ILogger<TopicClient>
logger
)
22
{
23
ArgumentNullException.ThrowIfNull(
logger
);
24
25
// Don't want the debug logs Topic client spits out either, they're too verbose
26
if
(
logger
.IsEnabled(LogLevel.Trace))
27
this.logger =
logger
;
28
}
29
31
public
ITopicClient
CreateTopicClient
(TimeSpan timeout)
32
=>
new
TopicClient(
33
new
SocketParameters
34
{
35
ConnectTimeout = timeout,
36
DisconnectTimeout = timeout,
37
ReceiveTimeout = timeout,
38
SendTimeout = timeout,
39
},
40
logger
);
41
}
42
}
Tgstation.Server.Host.Components.Session.TopicClientFactory
Definition
TopicClientFactory.cs:11
Tgstation.Server.Host.Components.Session.TopicClientFactory.TopicClientFactory
TopicClientFactory(ILogger< TopicClient > logger)
Initializes a new instance of the TopicClientFactory class.
Definition
TopicClientFactory.cs:21
Tgstation.Server.Host.Components.Session.TopicClientFactory.CreateTopicClient
ITopicClient CreateTopicClient(TimeSpan timeout)
Create a ITopicClient.A new ITopicClient.
Tgstation.Server.Host.Components.Session.TopicClientFactory.logger
readonly? ILogger< TopicClient > logger
The ILogger for created ITopicClients.
Definition
TopicClientFactory.cs:15
Tgstation.Server.Host.Components.Session.ITopicClientFactory
Factory for ITopicClients.
Definition
ITopicClientFactory.cs:11
Tgstation.Server.Host.Components.Session
Definition
ApiValidationStatus.cs:2
Generated by
1.9.8