public static unsafe string ReceiveText(this ZmqSocket socket, ZmqSendReceiveFlags flags = ZmqSendReceiveFlags.None, Encoding encoding = null) { using var result = new ZmqMessage(); socket.Receive(result, flags); return((encoding ?? Encoding.UTF8).GetString((byte *)result.DangerousGetData(), result.Size)); }
public static byte[] Receive(this ZmqSocket socket, ZmqSendReceiveFlags flags = ZmqSendReceiveFlags.None) { using var result = new ZmqMessage(); socket.Receive(result, flags); return(result.ToArray()); }