18 using System.Net.Sockets;
19 using Newtonsoft.Json;
37 private PushSocket _server;
55 _server =
new PushSocket(
"@tcp://*:" + _port);
75 if (!notification.CanSend())
77 Log.
Error(
"Messaging.SendNotification(): Send not implemented for notification of type: " + notification.GetType().Name);
97 var payload = JsonConvert.SerializeObject(packet, _orderEventJsonConverter);
99 var message =
new NetMQMessage();
101 message.Append(payload);
103 _server.SendMultipartMessage(message);
109 private void CheckPort()
113 TcpListener tcpListener =
new TcpListener(IPAddress.Any, _port.ToInt32());
119 throw new Exception(
"The port configured in config.json is either being used or blocked by a firewall." +
120 "Please choose a new port or open the port in the firewall.");