private void SendUdpUnicast(byte[] data) { if (!_sending) { return; } var ep = IpUtil.Parse(IpAddress, 60222); _sender.SendTo(data, ep); }
public void StartStream() { if (Streaming) { return; } LogUtil.Write("WLED: Initializing stream."); var onObj = new JObject( new JProperty("on", true), new JProperty("bri", 255) ); SendPost(onObj); _stripSender = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); _stripSender.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true); _stripSender.Blocking = false; _stripSender.EnableBroadcast = false; ep = IpUtil.Parse(IpAddress, port); Streaming = true; LogUtil.Write("WLED: Streaming started..."); }