tgstation-server  4.4.0
The /tg/station 13 server suite
TopicClientFactory.cs
Go to the documentation of this file.
1 using Byond.TopicSender;
2 using Microsoft.Extensions.Logging;
3 using System;
4 
5 namespace Tgstation.Server.Host.Components.Session
6 {
9  {
13  readonly ILogger<TopicClient> logger;
14 
19  public TopicClientFactory(ILogger<TopicClient> logger)
20  {
21  this.logger = logger ?? throw new ArgumentNullException(nameof(logger));
22  }
23 
25  public ITopicClient CreateTopicClient(TimeSpan timeout)
26  => new TopicClient(
27  new SocketParameters
28  {
29  ConnectTimeout = timeout,
30  DisconnectTimeout = timeout,
31  ReceiveTimeout = timeout,
32  SendTimeout = timeout
33  },
34  logger);
35  }
36 }
TopicClientFactory(ILogger< TopicClient > logger)
Initializes a new instance of the TopicClientFactory .
readonly ILogger< TopicClient > logger
The ILogger for created ITopicClients.