Skip to content

Commit

Permalink
Merge pull request #4 from eitamb/master
Browse files Browse the repository at this point in the history
Bug fixes from main repository
  • Loading branch information
somdoron committed May 6, 2016
2 parents 3841186 + ac53f1d commit 66bb52f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/NetMQ/Core/SocketBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,6 @@ protected virtual void XHiccuped([NotNull] Pipe pipe)
/// <summary>
/// Handle input-ready events by receiving and processing any incoming commands.
/// </summary>
/// <exception cref="TerminatingException">the context must not already be terminating</exception>
public virtual void InEvent()
{
// This function is invoked only once the socket is running in the context
Expand All @@ -1216,6 +1215,10 @@ public virtual void InEvent()
{
ProcessCommands(0, false);
}
catch
{
// ignored
}
finally
{
CheckDestroy();
Expand Down
1 change: 1 addition & 0 deletions src/NetMQ/Devices/DeviceBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ public void Stop(bool waitForCloseToComplete = true)

FrontendSocket.Close();
BackendSocket.Close();
m_poller.Dispose();
IsRunning = false;
}

Expand Down
4 changes: 3 additions & 1 deletion src/NetMQ/INetMQPoller.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System;

namespace NetMQ
{
public interface INetMQPoller
public interface INetMQPoller : IDisposable
{
void Run();
void RunAsync();
Expand Down
7 changes: 4 additions & 3 deletions src/NetMQ/NetMQBeacon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,10 @@ public void Run(PairSocket shim)
m_pingTimer.Elapsed += PingElapsed;
m_pingTimer.Enable = false;

m_poller = new NetMQPoller { m_pipe, m_pingTimer };

m_poller.Run();
using (m_poller = new NetMQPoller { m_pipe, m_pingTimer })
{
m_poller.Run();
}

// the beacon might never been configured
if (m_udpSocket != null)
Expand Down

0 comments on commit 66bb52f

Please sign in to comment.