aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/Net
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Model/Net')
-rw-r--r--MediaBrowser.Model/Net/ISocket.cs6
-rw-r--r--MediaBrowser.Model/Net/ISocketFactory.cs3
-rw-r--r--MediaBrowser.Model/Net/MimeTypes.cs21
-rw-r--r--MediaBrowser.Model/Net/NetworkShare.cs33
-rw-r--r--MediaBrowser.Model/Net/SocketReceiveResult.cs4
-rw-r--r--MediaBrowser.Model/Net/WebSocketMessage.cs2
6 files changed, 24 insertions, 45 deletions
diff --git a/MediaBrowser.Model/Net/ISocket.cs b/MediaBrowser.Model/Net/ISocket.cs
index 5b6ed92df..3de41d565 100644
--- a/MediaBrowser.Model/Net/ISocket.cs
+++ b/MediaBrowser.Model/Net/ISocket.cs
@@ -23,6 +23,12 @@ namespace MediaBrowser.Model.Net
/// <summary>
/// Sends a UDP message to a particular end point (uni or multicast).
/// </summary>
+ /// <param name="buffer">An array of type <see cref="byte" /> that contains the data to send.</param>
+ /// <param name="offset">The zero-based position in buffer at which to begin sending data.</param>
+ /// <param name="bytes">The number of bytes to send.</param>
+ /// <param name="endPoint">An <see cref="IPEndPoint" /> that represents the remote device.</param>
+ /// <param name="cancellationToken">The cancellation token to cancel operation.</param>
+ /// <returns>The task object representing the asynchronous operation.</returns>
Task SendToAsync(byte[] buffer, int offset, int bytes, IPEndPoint endPoint, CancellationToken cancellationToken);
}
}
diff --git a/MediaBrowser.Model/Net/ISocketFactory.cs b/MediaBrowser.Model/Net/ISocketFactory.cs
index 363abefc1..1527ef595 100644
--- a/MediaBrowser.Model/Net/ISocketFactory.cs
+++ b/MediaBrowser.Model/Net/ISocketFactory.cs
@@ -14,6 +14,9 @@ namespace MediaBrowser.Model.Net
/// <summary>
/// Creates a new unicast socket using the specified local port number.
/// </summary>
+ /// <param name="localIp">The local IP address to bind to.</param>
+ /// <param name="localPort">The local port to bind to.</param>
+ /// <returns>A new unicast socket using the specified local port number.</returns>
ISocket CreateSsdpUdpSocket(IPAddress localIp, int localPort);
/// <summary>
diff --git a/MediaBrowser.Model/Net/MimeTypes.cs b/MediaBrowser.Model/Net/MimeTypes.cs
index 902db1e9e..96f5ab51a 100644
--- a/MediaBrowser.Model/Net/MimeTypes.cs
+++ b/MediaBrowser.Model/Net/MimeTypes.cs
@@ -91,9 +91,9 @@ namespace MediaBrowser.Model.Net
{ ".webp", "image/webp" },
// Type font
- { ".ttf" , "font/ttf" },
- { ".woff" , "font/woff" },
- { ".woff2" , "font/woff2" },
+ { ".ttf", "font/ttf" },
+ { ".woff", "font/woff" },
+ { ".woff2", "font/woff2" },
// Type text
{ ".ass", "text/x-ssa" },
@@ -168,14 +168,17 @@ namespace MediaBrowser.Model.Net
/// <summary>
/// Gets the type of the MIME.
/// </summary>
- public static string? GetMimeType(string path, bool enableStreamDefault)
+ /// <param name="filename">The filename to find the MIME type of.</param>
+ /// <param name="enableStreamDefault">Whether of not to return a default value if no fitting MIME type is found.</param>
+ /// <returns>The worrect MIME type for the given filename, or `null` if it wasn't found and <paramref name="enableStreamDefault"/> is false.</returns>
+ public static string? GetMimeType(string filename, bool enableStreamDefault)
{
- if (path.Length == 0)
+ if (filename.Length == 0)
{
- throw new ArgumentException("String can't be empty.", nameof(path));
+ throw new ArgumentException("String can't be empty.", nameof(filename));
}
- var ext = Path.GetExtension(path);
+ var ext = Path.GetExtension(filename);
if (_mimeTypeLookup.TryGetValue(ext, out string? result))
{
@@ -210,9 +213,9 @@ namespace MediaBrowser.Model.Net
return enableStreamDefault ? "application/octet-stream" : null;
}
- public static string? ToExtension(string? mimeType)
+ public static string? ToExtension(string mimeType)
{
- if (string.IsNullOrEmpty(mimeType))
+ if (mimeType.Length == 0)
{
throw new ArgumentException("String can't be empty.", nameof(mimeType));
}
diff --git a/MediaBrowser.Model/Net/NetworkShare.cs b/MediaBrowser.Model/Net/NetworkShare.cs
deleted file mode 100644
index 6344cbe21..000000000
--- a/MediaBrowser.Model/Net/NetworkShare.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-#nullable disable
-#pragma warning disable CS1591
-
-namespace MediaBrowser.Model.Net
-{
- public class NetworkShare
- {
- /// <summary>
- /// The name of the computer that this share belongs to.
- /// </summary>
- public string Server { get; set; }
-
- /// <summary>
- /// Share name.
- /// </summary>
- public string Name { get; set; }
-
- /// <summary>
- /// Local path.
- /// </summary>
- public string Path { get; set; }
-
- /// <summary>
- /// Share type.
- /// </summary>
- public NetworkShareType ShareType { get; set; }
-
- /// <summary>
- /// Comment.
- /// </summary>
- public string Remark { get; set; }
- }
-}
diff --git a/MediaBrowser.Model/Net/SocketReceiveResult.cs b/MediaBrowser.Model/Net/SocketReceiveResult.cs
index 54139fe9c..1524786ea 100644
--- a/MediaBrowser.Model/Net/SocketReceiveResult.cs
+++ b/MediaBrowser.Model/Net/SocketReceiveResult.cs
@@ -20,12 +20,12 @@ namespace MediaBrowser.Model.Net
public int ReceivedBytes { get; set; }
/// <summary>
- /// The <see cref="IPEndPoint"/> the data was received from.
+ /// Gets or sets the <see cref="IPEndPoint"/> the data was received from.
/// </summary>
public IPEndPoint RemoteEndPoint { get; set; }
/// <summary>
- /// The local <see cref="IPAddress"/>.
+ /// Gets or sets the local <see cref="IPAddress"/>.
/// </summary>
public IPAddress LocalIPAddress { get; set; }
}
diff --git a/MediaBrowser.Model/Net/WebSocketMessage.cs b/MediaBrowser.Model/Net/WebSocketMessage.cs
index bffbbe612..b00158cb3 100644
--- a/MediaBrowser.Model/Net/WebSocketMessage.cs
+++ b/MediaBrowser.Model/Net/WebSocketMessage.cs
@@ -9,7 +9,7 @@ namespace MediaBrowser.Model.Net
/// <summary>
/// Class WebSocketMessage.
/// </summary>
- /// <typeparam name="T"></typeparam>
+ /// <typeparam name="T">The type of the data.</typeparam>
public class WebSocketMessage<T>
{
/// <summary>