Skip to content

Commit e4dfcf9

Browse files
authored
Merge pull request zeromq#830 from amichel/master
fixes zeromq#829 issue with NetMqMonitor backward compatibility
2 parents 96555bf + 767c2ac commit e4dfcf9

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/NetMQ/ISocketPollableCollection.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using JetBrains.Annotations;
23
using NetMQ.Monitoring;
34

@@ -13,5 +14,6 @@ public interface ISocketPollableCollection
1314
{
1415
void Add([NotNull] ISocketPollable socket);
1516
void Remove([NotNull] ISocketPollable socket);
17+
void RemoveAndDispose<T>(T socket) where T : ISocketPollable, IDisposable;
1618
}
1719
}

src/NetMQ/Monitoring/NetMQMonitor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class NetMQMonitor : IDisposable
2424
{
2525
[NotNull] private readonly NetMQSocket m_monitoringSocket;
2626
private readonly bool m_ownsMonitoringSocket;
27-
[CanBeNull] private NetMQPoller m_attachedPoller;
27+
[CanBeNull] private ISocketPollableCollection m_attachedPoller;
2828
private int m_cancel;
2929

3030
private readonly ManualResetEvent m_isStoppedEvent = new ManualResetEvent(true);
@@ -216,7 +216,7 @@ private void InternalClose()
216216
}
217217
}
218218

219-
public void AttachToPoller([NotNull] NetMQPoller poller)
219+
public void AttachToPoller<T>(T poller) where T : ISocketPollableCollection
220220
{
221221
if (poller == null)
222222
throw new ArgumentNullException(nameof(poller));

0 commit comments

Comments
 (0)