diff options
Diffstat (limited to 'Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.cs')
| -rw-r--r-- | Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.cs | 62 |
1 files changed, 16 insertions, 46 deletions
diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.cs index c781bccbb7..fd78dfa8e7 100644 --- a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.cs +++ b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.IO; using System.Threading; using System.Threading.Tasks; @@ -38,7 +38,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun EnableStreamSharing = true; } - private Socket CreateSocket(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType) + private static Socket CreateSocket(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType) { var socket = new Socket(addressFamily, SocketType.Stream, ProtocolType.Tcp); @@ -144,7 +144,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun }); } - private void Resolve(TaskCompletionSource<bool> openTaskCompletionSource) + private static void Resolve(TaskCompletionSource<bool> openTaskCompletionSource) { Task.Run(() => { @@ -204,16 +204,16 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun public override async Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) { if (buffer == null) - throw new ArgumentNullException("buffer"); + throw new ArgumentNullException(nameof(buffer)); if (offset + count < 0) - throw new ArgumentOutOfRangeException("offset + count must not be negative", "offset+count"); + throw new ArgumentOutOfRangeException(nameof(offset), "offset + count must not be negative"); if (offset + count > buffer.Length) - throw new ArgumentException("offset + count must not be greater than the length of buffer", "offset+count"); + throw new ArgumentException("offset + count must not be greater than the length of buffer"); if (disposed) - throw new ObjectDisposedException(typeof(UdpClientStream).ToString()); + throw new ObjectDisposedException(nameof(UdpClientStream)); // This will always receive a 1328 packet size (PacketSize + RtpHeaderSize) // The RTP header will be stripped so see how many reads we need to make to fill the buffer. @@ -238,16 +238,16 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun public override int Read(byte[] buffer, int offset, int count) { if (buffer == null) - throw new ArgumentNullException("buffer"); + throw new ArgumentNullException(nameof(buffer)); if (offset + count < 0) throw new ArgumentOutOfRangeException("offset + count must not be negative", "offset+count"); if (offset + count > buffer.Length) - throw new ArgumentException("offset + count must not be greater than the length of buffer", "offset+count"); + throw new ArgumentException("offset + count must not be greater than the length of buffer"); if (disposed) - throw new ObjectDisposedException(typeof(UdpClientStream).ToString()); + throw new ObjectDisposedException(nameof(UdpClientStream)); // This will always receive a 1328 packet size (PacketSize + RtpHeaderSize) // The RTP header will be stripped so see how many reads we need to make to fill the buffer. @@ -274,49 +274,19 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun disposed = true; } - public override bool CanRead - { - get - { - throw new NotImplementedException(); - } - } + public override bool CanRead => throw new NotImplementedException(); - public override bool CanSeek - { - get - { - throw new NotImplementedException(); - } - } + public override bool CanSeek => throw new NotImplementedException(); - public override bool CanWrite - { - get - { - throw new NotImplementedException(); - } - } + public override bool CanWrite => throw new NotImplementedException(); - public override long Length - { - get - { - throw new NotImplementedException(); - } - } + public override long Length => throw new NotImplementedException(); public override long Position { - get - { - throw new NotImplementedException(); - } + get => throw new NotImplementedException(); - set - { - throw new NotImplementedException(); - } + set => throw new NotImplementedException(); } public override void Flush() |
