public static void Send(this ZmqSocket socket, byte[] message, ZmqSendReceiveFlags flags = ZmqSendReceiveFlags.None) { if (message == null) { throw new ArgumentNullException(nameof(message)); } using var msg = new ZmqMessage(message); socket.Send(msg, flags); }
public static void SendText(this ZmqSocket socket, string message, ZmqSendReceiveFlags flags = ZmqSendReceiveFlags.None, Encoding encoding = null) { if (message == null) { throw new ArgumentNullException(nameof(message)); } var messageBytes = (encoding ?? Encoding.UTF8).GetBytes(message); socket.Send(messageBytes, flags); }