Skip to content

Commit

Permalink
ITrackerListener should implement IDisposable
Browse files Browse the repository at this point in the history
It's nice to be able to wrap it in a 'using' statement
  • Loading branch information
alanmcgovern committed Jul 28, 2024
1 parent a276426 commit 9bf3224
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,10 @@ public void Stop ()
RaiseStatusChanged (ListenerStatus.NotListening);
}
}

public void Dispose ()
{
Cancellation?.Cancel ();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace MonoTorrent.Connections.TrackerServer
/// <summary>
/// Listens for incoming Announce or Scrape requests and sends the response back.
/// </summary>
public interface ITrackerListener : IListener
public interface ITrackerListener : IListener, IDisposable
{
event EventHandler<ScrapeRequest> ScrapeReceived;
event EventHandler<AnnounceRequest> AnnounceReceived;
Expand Down

0 comments on commit 9bf3224

Please sign in to comment.