Skip to content

Commit

Permalink
Merge pull request #8 from davidbutlerdesign/develop
Browse files Browse the repository at this point in the history
Pull changes from master
  • Loading branch information
David Butler authored Sep 28, 2020
2 parents cf90da3 + 271b843 commit 9817c12
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
1 change: 0 additions & 1 deletion example/DBDesign.PosiStageDotNet.Client/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
using System.Linq;
using System.Net;
using System.Threading;
using System.Xml.Linq;

namespace DBDesign.PosiStageDotNet.Client
{
Expand Down
18 changes: 7 additions & 11 deletions src/DBDesign.PosiStageDotNet/PsnClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ public class PsnClient : IDisposable
/// <param name="isStrict">If true, packets which are imperfect in any way will not be processed</param>
public PsnClient([NotNull] IPAddress localIp, bool isStrict = true)
{
Trackers = new ReadOnlyDictionary<int, PsnTracker>(_trackers);

MulticastIp = DefaultMulticastIp;
MulticastIp = DefaultMulticastIp;
Port = DefaultPort;
LocalIp = localIp;
IsStrict = isStrict;
Expand All @@ -100,9 +98,7 @@ public PsnClient([NotNull] IPAddress localIp, bool isStrict = true)
/// <exception cref="ArgumentOutOfRangeException"></exception>
public PsnClient([NotNull] IPAddress localIp, [NotNull] IPAddress customMulticastIp, int customPort, bool isStrict = true)
{
Trackers = new ReadOnlyDictionary<int, PsnTracker>(_trackers);

if (customMulticastIp == null)
if (customMulticastIp == null)
throw new ArgumentNullException(nameof(customMulticastIp));
if (!customMulticastIp.IsIPv4Multicast())
throw new ArgumentException("Not a valid IPv4 multicast address", nameof(customMulticastIp));
Expand Down Expand Up @@ -147,10 +143,10 @@ public PsnClient([NotNull] IPAddress localIp, [NotNull] IPAddress customMulticas
/// </summary>
public bool IsListening { get; private set; }

/// <summary>
/// Dictionary of trackers keyed by tracker index
/// </summary>
public ReadOnlyDictionary<int, PsnTracker> Trackers { get; }
/// <summary>
/// Dictionary of trackers keyed by tracker index
/// </summary>
public IReadOnlyDictionary<int, PsnTracker> Trackers => _trackers;

/// <summary>
/// System name of the remote PosiStageNet server, or null if no info packets have been received
Expand All @@ -177,7 +173,7 @@ public void Dispose()
/// <summary>
/// Called when a PosiStageNet data or info packet is received
/// </summary>
public event EventHandler<ReadOnlyDictionary<int, PsnTracker>> TrackersUpdated;
public event EventHandler<IReadOnlyDictionary<int, PsnTracker>> TrackersUpdated;

/// <summary>
/// Called when a PosiStageNet info packet is received
Expand Down

0 comments on commit 9817c12

Please sign in to comment.