Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/ZeroMQ/SocketOption.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,6 @@ internal enum SocketOption
TCP_KEEPALIVE_IDLE = 36,
TCP_KEEPALIVE_INTVL = 37,
TCP_ACCEPT_FILTER = 38,
XPUB_VERBOSE = 40,
}
}
21 changes: 21 additions & 0 deletions src/ZeroMQ/XpubVerboseBehavior.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

namespace ZeroMQ
{
/// <summary>
/// Specifies <see cref="SocketType.XPUB"/> socket behavior on new subscriptions
/// and unsubscriptions.
/// </summary>
public enum XpubVerboseBehaviour
{
/// <summary>
/// Only pass new subscription messages upstream.
/// </summary>
NewSubscriptionsOnly = 0,

/// <summary>
/// Pass all subscriptioon messages upstream
/// enabling blocking sends.
/// </summary>
AllSubscriptions = 1,
}
}
1 change: 1 addition & 0 deletions src/ZeroMQ/ZeroMQ.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
<Compile Include="Monitoring\MonitorSocketExtensions.cs" />
<Compile Include="RouterBehavior.cs" />
<Compile Include="TcpKeepaliveBehaviour.cs" />
<Compile Include="XpubVerboseBehavior.cs" />
<Compile Include="ZmqMessage.cs" />
<Compile Include="Poller.cs" />
<Compile Include="SendReceiveExtensions.cs" />
Expand Down
17 changes: 15 additions & 2 deletions src/ZeroMQ/ZmqSocket.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace ZeroMQ
{
using System;
using Interop;
using System;

/// <summary>
/// Sends and receives messages across various transports to potentially multiple endpoints
Expand Down Expand Up @@ -306,7 +306,7 @@ public RouterBehavior RouterBehavior
{
set { ZmqVersion.OnlyIfAtLeast(LatestVersion, () => SetSocketOption(SocketOption.ROUTER_BEHAVIOR, (int)value)); }
}

/// <summary>
/// Gets or sets the override value for the SO_KEEPALIVE TCP socket option. (where supported by OS). (Default = -1, OS default).
/// </summary>
Expand Down Expand Up @@ -360,6 +360,19 @@ public int TcpKeepaliveIntvl
set { ZmqVersion.OnlyIfAtLeast(LatestVersion, () => SetSocketOption(SocketOption.TCP_KEEPALIVE_INTVL, value)); }
}

/// <summary>
/// Sets the xpub verbose behavior on the current socket.(Default = <see cref="ZeroMQ.XpubVerboseBehaviour.NewSubscriptionsOnly"/>).
/// Only applicable to the <see cref="ZeroMQ.SocketType.XPUB"/> socket type.
/// </summary>
/// <exception cref="ZmqVersionException">This socket option was used in ZeroMQ 2.x or lower.</exception>
/// <exception cref="ZmqSocketException">An error occurred when setting the socket option.</exception>
/// <exception cref="ObjectDisposedException">The <see cref="ZmqSocket"/> has been closed.</exception>
/// <remarks>Not supported in 0MQ version 2.</remarks>
public XpubVerboseBehaviour XPubVerbose
{
set { ZmqVersion.OnlyIfAtLeast(LatestVersion, () => SetSocketOption(SocketOption.XPUB_VERBOSE, (int)value)); }
}

/// <summary>
/// Gets the status of the last Receive operation.
/// </summary>
Expand Down