tgstation-server 5.12.7
The /tg/station 13 server suite
Loading...
Searching...
No Matches
TopicClientFactory.cs
Go to the documentation of this file.
1using System;
2
3using Byond.TopicSender;
4using Microsoft.Extensions.Logging;
5
7{
10 {
14 readonly ILogger<TopicClient> logger;
15
20 public TopicClientFactory(ILogger<TopicClient> logger)
21 {
22 ArgumentNullException.ThrowIfNull(logger);
23
24 // Don't want the debug logs Topic client spits out either, they're too verbose
25 if (logger.IsEnabled(LogLevel.Trace))
26 this.logger = logger;
27 }
28
30 public ITopicClient CreateTopicClient(TimeSpan timeout)
31 => new TopicClient(
32 new SocketParameters
33 {
34 ConnectTimeout = timeout,
35 DisconnectTimeout = timeout,
36 ReceiveTimeout = timeout,
37 SendTimeout = timeout,
38 },
39 logger);
40 }
41}
TopicClientFactory(ILogger< TopicClient > logger)
Initializes a new instance of the TopicClientFactory class.
readonly ILogger< TopicClient > logger
The ILogger for created ITopicClients.
ITopicClient CreateTopicClient(TimeSpan timeout)
Create a ITopicClient. A new ITopicClient.