using MessagePack; using NetMQ; using NetMQ.Sockets; namespace Azaion.CommonSecurity; public static class ZeroMqExtensions { public static T? Get(this DealerSocket dealer, out byte[] message) { if (!dealer.TryReceiveFrameBytes(TimeSpan.FromMinutes(2), out var bytes)) throw new Exception($"Unable to get {typeof(T).Name}"); message = bytes; return MessagePackSerializer.Deserialize(bytes); } }