mirror of
				https://github.com/jellyfin/jellyfin.git
				synced 2025-11-04 03:27:21 -05:00 
			
		
		
		
	Use file-scoped namespaces in Jellyfin.Networking
This commit is contained in:
		
							parent
							
								
									1b821efcf2
								
							
						
					
					
						commit
						eea676429b
					
				@ -16,13 +16,13 @@ using MediaBrowser.Controller.Plugins;
 | 
				
			|||||||
using Microsoft.Extensions.Logging;
 | 
					using Microsoft.Extensions.Logging;
 | 
				
			||||||
using Mono.Nat;
 | 
					using Mono.Nat;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Jellyfin.Networking
 | 
					namespace Jellyfin.Networking;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/// <summary>
 | 
				
			||||||
 | 
					/// Server entrypoint handling external port forwarding.
 | 
				
			||||||
 | 
					/// </summary>
 | 
				
			||||||
 | 
					public sealed class ExternalPortForwarding : IServerEntryPoint
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /// <summary>
 | 
					 | 
				
			||||||
    /// Server entrypoint handling external port forwarding.
 | 
					 | 
				
			||||||
    /// </summary>
 | 
					 | 
				
			||||||
    public sealed class ExternalPortForwarding : IServerEntryPoint
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
    private readonly IServerApplicationHost _appHost;
 | 
					    private readonly IServerApplicationHost _appHost;
 | 
				
			||||||
    private readonly ILogger<ExternalPortForwarding> _logger;
 | 
					    private readonly ILogger<ExternalPortForwarding> _logger;
 | 
				
			||||||
    private readonly IServerConfigurationManager _config;
 | 
					    private readonly IServerConfigurationManager _config;
 | 
				
			||||||
@ -192,5 +192,4 @@ namespace Jellyfin.Networking
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        _disposed = true;
 | 
					        _disposed = true;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -30,15 +30,15 @@ using System.Net.Sockets;
 | 
				
			|||||||
using System.Threading;
 | 
					using System.Threading;
 | 
				
			||||||
using System.Threading.Tasks;
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Jellyfin.Networking.HappyEyeballs
 | 
					namespace Jellyfin.Networking.HappyEyeballs;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/// <summary>
 | 
				
			||||||
 | 
					/// Defines the <see cref="HttpClientExtension"/> class.
 | 
				
			||||||
 | 
					///
 | 
				
			||||||
 | 
					/// Implementation taken from https://github.com/ppy/osu-framework/pull/4191 .
 | 
				
			||||||
 | 
					/// </summary>
 | 
				
			||||||
 | 
					public static class HttpClientExtension
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /// <summary>
 | 
					 | 
				
			||||||
    /// Defines the <see cref="HttpClientExtension"/> class.
 | 
					 | 
				
			||||||
    ///
 | 
					 | 
				
			||||||
    /// Implementation taken from https://github.com/ppy/osu-framework/pull/4191 .
 | 
					 | 
				
			||||||
    /// </summary>
 | 
					 | 
				
			||||||
    public static class HttpClientExtension
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// Gets or sets a value indicating whether the client should use IPv6.
 | 
					    /// Gets or sets a value indicating whether the client should use IPv6.
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
@ -116,5 +116,4 @@ namespace Jellyfin.Networking.HappyEyeballs
 | 
				
			|||||||
            throw;
 | 
					            throw;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -18,13 +18,13 @@ using static MediaBrowser.Controller.Extensions.ConfigurationExtensions;
 | 
				
			|||||||
using IConfigurationManager = MediaBrowser.Common.Configuration.IConfigurationManager;
 | 
					using IConfigurationManager = MediaBrowser.Common.Configuration.IConfigurationManager;
 | 
				
			||||||
using IPNetwork = Microsoft.AspNetCore.HttpOverrides.IPNetwork;
 | 
					using IPNetwork = Microsoft.AspNetCore.HttpOverrides.IPNetwork;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Jellyfin.Networking.Manager
 | 
					namespace Jellyfin.Networking.Manager;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/// <summary>
 | 
				
			||||||
 | 
					/// Class to take care of network interface management.
 | 
				
			||||||
 | 
					/// </summary>
 | 
				
			||||||
 | 
					public class NetworkManager : INetworkManager, IDisposable
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /// <summary>
 | 
					 | 
				
			||||||
    /// Class to take care of network interface management.
 | 
					 | 
				
			||||||
    /// </summary>
 | 
					 | 
				
			||||||
    public class NetworkManager : INetworkManager, IDisposable
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// Threading lock for network properties.
 | 
					    /// Threading lock for network properties.
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
@ -1122,5 +1122,4 @@ namespace Jellyfin.Networking.Manager
 | 
				
			|||||||
            _logger.Log(logLevel, "Filter list: {0}", _remoteAddressFilter.Select(s => s.Prefix + "/" + s.PrefixLength));
 | 
					            _logger.Log(logLevel, "Filter list: {0}", _remoteAddressFilter.Select(s => s.Prefix + "/" + s.PrefixLength));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -3,13 +3,13 @@ using System.Net;
 | 
				
			|||||||
using System.Net.Sockets;
 | 
					using System.Net.Sockets;
 | 
				
			||||||
using MediaBrowser.Model.Net;
 | 
					using MediaBrowser.Model.Net;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Jellyfin.Networking.Udp
 | 
					namespace Jellyfin.Networking.Udp;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/// <summary>
 | 
				
			||||||
 | 
					/// Factory class to create different kinds of sockets.
 | 
				
			||||||
 | 
					/// </summary>
 | 
				
			||||||
 | 
					public class SocketFactory : ISocketFactory
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /// <summary>
 | 
					 | 
				
			||||||
    /// Factory class to create different kinds of sockets.
 | 
					 | 
				
			||||||
    /// </summary>
 | 
					 | 
				
			||||||
    public class SocketFactory : ISocketFactory
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
    /// <inheritdoc />
 | 
					    /// <inheritdoc />
 | 
				
			||||||
    public Socket CreateUdpBroadcastSocket(int localPort)
 | 
					    public Socket CreateUdpBroadcastSocket(int localPort)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
@ -35,5 +35,4 @@ namespace Jellyfin.Networking.Udp
 | 
				
			|||||||
            throw;
 | 
					            throw;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -11,13 +11,13 @@ using Microsoft.Extensions.Configuration;
 | 
				
			|||||||
using Microsoft.Extensions.Logging;
 | 
					using Microsoft.Extensions.Logging;
 | 
				
			||||||
using static MediaBrowser.Controller.Extensions.ConfigurationExtensions;
 | 
					using static MediaBrowser.Controller.Extensions.ConfigurationExtensions;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Jellyfin.Networking.Udp
 | 
					namespace Jellyfin.Networking.Udp;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/// <summary>
 | 
				
			||||||
 | 
					/// Provides a Udp Server.
 | 
				
			||||||
 | 
					/// </summary>
 | 
				
			||||||
 | 
					public sealed class UdpServer : IDisposable
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /// <summary>
 | 
					 | 
				
			||||||
    /// Provides a Udp Server.
 | 
					 | 
				
			||||||
    /// </summary>
 | 
					 | 
				
			||||||
    public sealed class UdpServer : IDisposable
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// The _logger.
 | 
					    /// The _logger.
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
@ -133,5 +133,4 @@ namespace Jellyfin.Networking.Udp
 | 
				
			|||||||
        _udpSocket.Dispose();
 | 
					        _udpSocket.Dispose();
 | 
				
			||||||
        _disposed = true;
 | 
					        _disposed = true;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -13,13 +13,13 @@ using Microsoft.Extensions.Configuration;
 | 
				
			|||||||
using Microsoft.Extensions.Logging;
 | 
					using Microsoft.Extensions.Logging;
 | 
				
			||||||
using IConfigurationManager = MediaBrowser.Common.Configuration.IConfigurationManager;
 | 
					using IConfigurationManager = MediaBrowser.Common.Configuration.IConfigurationManager;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Jellyfin.Networking
 | 
					namespace Jellyfin.Networking;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/// <summary>
 | 
				
			||||||
 | 
					/// Class responsible for registering all UDP broadcast endpoints and their handlers.
 | 
				
			||||||
 | 
					/// </summary>
 | 
				
			||||||
 | 
					public sealed class UdpServerEntryPoint : IServerEntryPoint
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    /// <summary>
 | 
					 | 
				
			||||||
    /// Class responsible for registering all UDP broadcast endpoints and their handlers.
 | 
					 | 
				
			||||||
    /// </summary>
 | 
					 | 
				
			||||||
    public sealed class UdpServerEntryPoint : IServerEntryPoint
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// The port of the UDP server.
 | 
					    /// The port of the UDP server.
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
@ -140,5 +140,4 @@ namespace Jellyfin.Networking
 | 
				
			|||||||
        _udpServers.Clear();
 | 
					        _udpServers.Clear();
 | 
				
			||||||
        _disposed = true;
 | 
					        _disposed = true;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user