public int SetSocketOption(int option, ulong value) { using (var optionValue = new DisposableIntPtr(Marshal.SizeOf(typeof(ulong)))) { Marshal.WriteInt64(optionValue, unchecked (Convert.ToInt64(value))); return(RetryIfInterrupted(() => LibZmq.zmq_setsockopt(SocketHandle, option, optionValue, sizeof(ulong)))); } }
public int SetSocketOption(int option, byte[] value) { using (var optionValue = new DisposableIntPtr(value.Length)) { Marshal.Copy(value, 0, optionValue, value.Length); return(RetryIfInterrupted(() => LibZmq.zmq_setsockopt(SocketHandle, option, optionValue, value.Length))); } }
public int SetSocketOption(int option, int value) { using (var optionValue = new DisposableIntPtr(Marshal.SizeOf(typeof(int)))) { Marshal.WriteInt32(optionValue, value); return(RetryIfInterrupted(() => LibZmq.zmq_setsockopt(SocketHandle, option, optionValue, sizeof(int)))); } }