public ZmqEndpointViewModelGet(ZmqEndpoint domain) { Address = domain.Address; Topics = domain.Topics; LastPingAt = domain.LastPingAt.ToUniversalTime(); LastMessageAt = domain.LastMessageAt?.ToUniversalTime(); }
public void should_serialize_deserialize() { var endpoint = new ZmqEndpoint("test"); var serialized = _serializer.Serialize(endpoint); var deserialized = _serializer.Deserialize(serialized); Assert.AreEqual(endpoint, deserialized); }
private void CreatePollingThread() { var socketsCreated = new AutoResetEvent(false); _pollingReceptionThread = new Thread(() => { CreateCommandReceiverSocket(_configuration.GetBindEndpoint()); socketsCreated.Set(); while (_running) { DoReceive(); } _receptionSocket.Dispose(); }); _pollingReceptionThread.Start(); socketsCreated.WaitOne(); _endpoint = new ZmqEndpoint(_configuration.GetConnectEndpoint()); }
private ZmqSocket CreatePushSocket(ZmqEndpoint zmqEndpoint) { _logger.Debug(string.Format("Creating zmq push socket to endpoint {0}", zmqEndpoint)); var socket = _context.CreateSocket(SocketType.PUSH); socket.SendHighWatermark = 30000; socket.Linger = TimeSpan.FromMilliseconds(200); socket.Connect(zmqEndpoint.Endpoint); return socket; }