diff --git a/src/ZeroMQ/SocketOption.cs b/src/ZeroMQ/SocketOption.cs index 3e48b05..4db9cec 100644 --- a/src/ZeroMQ/SocketOption.cs +++ b/src/ZeroMQ/SocketOption.cs @@ -42,5 +42,6 @@ internal enum SocketOption TCP_KEEPALIVE_IDLE = 36, TCP_KEEPALIVE_INTVL = 37, TCP_ACCEPT_FILTER = 38, + XPUB_VERBOSE = 40, } } \ No newline at end of file diff --git a/src/ZeroMQ/XpubVerboseBehavior.cs b/src/ZeroMQ/XpubVerboseBehavior.cs new file mode 100644 index 0000000..440f491 --- /dev/null +++ b/src/ZeroMQ/XpubVerboseBehavior.cs @@ -0,0 +1,21 @@ + +namespace ZeroMQ +{ + /// + /// Specifies socket behavior on new subscriptions + /// and unsubscriptions. + /// + public enum XpubVerboseBehaviour + { + /// + /// Only pass new subscription messages upstream. + /// + NewSubscriptionsOnly = 0, + + /// + /// Pass all subscriptioon messages upstream + /// enabling blocking sends. + /// + AllSubscriptions = 1, + } +} diff --git a/src/ZeroMQ/ZeroMQ.csproj b/src/ZeroMQ/ZeroMQ.csproj index 90e76f1..ff9131e 100644 --- a/src/ZeroMQ/ZeroMQ.csproj +++ b/src/ZeroMQ/ZeroMQ.csproj @@ -72,6 +72,7 @@ + diff --git a/src/ZeroMQ/ZmqSocket.cs b/src/ZeroMQ/ZmqSocket.cs index d846b92..4fa5da5 100644 --- a/src/ZeroMQ/ZmqSocket.cs +++ b/src/ZeroMQ/ZmqSocket.cs @@ -1,7 +1,7 @@ namespace ZeroMQ { - using System; using Interop; + using System; /// /// Sends and receives messages across various transports to potentially multiple endpoints @@ -306,7 +306,7 @@ public RouterBehavior RouterBehavior { set { ZmqVersion.OnlyIfAtLeast(LatestVersion, () => SetSocketOption(SocketOption.ROUTER_BEHAVIOR, (int)value)); } } - + /// /// Gets or sets the override value for the SO_KEEPALIVE TCP socket option. (where supported by OS). (Default = -1, OS default). /// @@ -360,6 +360,19 @@ public int TcpKeepaliveIntvl set { ZmqVersion.OnlyIfAtLeast(LatestVersion, () => SetSocketOption(SocketOption.TCP_KEEPALIVE_INTVL, value)); } } + /// + /// Sets the xpub verbose behavior on the current socket.(Default = ). + /// Only applicable to the socket type. + /// + /// This socket option was used in ZeroMQ 2.x or lower. + /// An error occurred when setting the socket option. + /// The has been closed. + /// Not supported in 0MQ version 2. + public XpubVerboseBehaviour XPubVerbose + { + set { ZmqVersion.OnlyIfAtLeast(LatestVersion, () => SetSocketOption(SocketOption.XPUB_VERBOSE, (int)value)); } + } + /// /// Gets the status of the last Receive operation. ///