public void SetOption(ZmqSocketOption option, int value) { while (ZmqNative.setsockopt(_handle, (int)option, &value, (IntPtr)sizeof(int)) == -1) { if (ZmqUtil.WasInterrupted()) { continue; } ZmqUtil.ThrowLastError($"Unable to set ZMQ socket option {option} to {value}"); } }
public void SetOption(ZmqSocketOption option, byte[] value) { fixed(byte *valuePtr = value) { while (ZmqNative.setsockopt(_handle, (int)option, valuePtr, (IntPtr)(value?.Length ?? 0)) == -1) { if (ZmqUtil.WasInterrupted()) { continue; } ZmqUtil.ThrowLastError($"Unable to set ZMQ socket option {option}"); } } }