<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[is there have UDP in publisher?]]></title><description><![CDATA[<p dir="auto">I see four protocols on the publisher page: BACnet、HTTP、Modbus、Twilio</p>
<p dir="auto">I want to use UDP to send data out.<br />
I think he should be in the HTTP protocol option.<br />
But I can't find it. It seems Only TCP in there.</p>
<p dir="auto">Is there a way to send data using UDP protocol?</p>
]]></description><link>https://forum.mango-os.com/topic/4144/is-there-have-udp-in-publisher</link><generator>RSS for Node</generator><lastBuildDate>Fri, 11 Sep 2026 00:53:09 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/4144.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 09 Apr 2019 06:45:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to is there have UDP in publisher? on Fri, 12 Apr 2019 06:54:57 GMT]]></title><description><![CDATA[<p dir="auto">I think I understand. Thank you very much!</p>
]]></description><link>https://forum.mango-os.com/post/21800</link><guid isPermaLink="true">https://forum.mango-os.com/post/21800</guid><dc:creator><![CDATA[cuihe]]></dc:creator><pubDate>Fri, 12 Apr 2019 06:54:57 GMT</pubDate></item><item><title><![CDATA[Reply to is there have UDP in publisher? on Wed, 10 Apr 2019 17:10:50 GMT]]></title><description><![CDATA[<p dir="auto">OK got you. Here's a meta data source you can import and use, you will have to change the <code>dataPointXid</code> of the context point to an actual point in your system. Script formatted below -</p>
<pre><code>{
  "dataSources":[
    {
      "xid":"DS_464401cf-d4f5-42e4-abb3-5cf0e7b43c99",
      "name":"UDP test",
      "enabled":true,
      "type":"META",
      "alarmLevels":{
        "SCRIPT_ERROR":"URGENT",
        "CONTEXT_POINT_DISABLED":"URGENT",
        "RESULT_TYPE_ERROR":"URGENT"
      },
      "purgeType":"YEARS",
      "editPermission":"",
      "purgeOverride":false,
      "purgePeriod":1
    }
  ],
  "dataPoints":[
    {
      "xid":"DP_02608a5a-1785-41b5-bc57-231b6823d810",
      "name":"UDP string sender",
      "enabled":true,
      "loggingType":"ON_CHANGE",
      "intervalLoggingPeriodType":"MINUTES",
      "intervalLoggingType":"INSTANT",
      "purgeType":"YEARS",
      "pointLocator":{
        "dataType":"ALPHANUMERIC",
        "updateEvent":"NONE",
        "contextUpdateEvent":"CONTEXT_UPDATE",
        "context":[
          {
            "varName":"input",
            "dataPointXid":"DP_d7f134b2-3940-4cc1-b9b3-2cf153342078",
            "updateContext":true
          }
        ],
        "logLevel":"NONE",
        "variableName":"point",
        "scriptPermissions":"superadmin",
        "executionDelaySeconds":0,
        "logCount":5,
        "logSize":1.0,
        "script":"var value = input.value;\nif (value == null) {\n    return value;\n}\n\nvar socket = new java.net.DatagramSocket();\ntry {\n    var address = java.net.InetAddress.getByName(\"10.55.55.10\");\n    var port = 1241;\n    \n    var valueBytes = value.getBytes(java.nio.charset.StandardCharsets.UTF_8);\n    var packet = new java.net.DatagramPacket(valueBytes, valueBytes.length, address, port);\n    \n    socket.send(packet);\n} finally {\n    socket.close();\n}\n\nreturn value;",
        "settable":false,
        "updateCronPattern":""
      },
      "eventDetectors":[
      ],
      "plotType":"STEP",
      "rollup":"NONE",
      "unit":"",
      "simplifyType":"NONE",
      "chartColour":"",
      "chartRenderer":{
        "type":"TABLE",
        "limit":10
      },
      "dataSourceXid":"DS_464401cf-d4f5-42e4-abb3-5cf0e7b43c99",
      "defaultCacheSize":1,
      "deviceName":"UDP sender",
      "discardExtremeValues":false,
      "discardHighLimit":1.7976931348623157E308,
      "discardLowLimit":-1.7976931348623157E308,
      "intervalLoggingPeriod":1,
      "intervalLoggingSampleWindowSize":0,
      "overrideIntervalLoggingSamples":false,
      "preventSetExtremeValues":false,
      "purgeOverride":false,
      "purgePeriod":1,
      "readPermission":"",
      "setExtremeHighLimit":1.7976931348623157E308,
      "setExtremeLowLimit":-1.7976931348623157E308,
      "setPermission":"",
      "tags":{
      },
      "textRenderer":{
        "type":"PLAIN",
        "useUnitAsSuffix":false,
        "suffix":""
      },
      "tolerance":0.0
    }
  ]
}
</code></pre>
<p dir="auto">Actual script</p>
<pre><code>var value = input.value;
if (value == null) {
    return value;
}

var socket = new java.net.DatagramSocket();
try {
    var address = java.net.InetAddress.getByName("10.55.55.10");
    var port = 1241;
    
    var valueBytes = value.getBytes(java.nio.charset.StandardCharsets.UTF_8);
    var packet = new java.net.DatagramPacket(valueBytes, valueBytes.length, address, port);
    
    socket.send(packet);
} finally {
    socket.close();
}

return value;
</code></pre>
]]></description><link>https://forum.mango-os.com/post/21791</link><guid isPermaLink="true">https://forum.mango-os.com/post/21791</guid><dc:creator><![CDATA[Jared Wiltshire]]></dc:creator><pubDate>Wed, 10 Apr 2019 17:10:50 GMT</pubDate></item><item><title><![CDATA[Reply to is there have UDP in publisher? on Wed, 10 Apr 2019 00:48:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jared-wiltshire" aria-label="Profile: jared-wiltshire">@<bdi>jared-wiltshire</bdi></a> <a class="plugin-mentions-user plugin-mentions-a" href="/user/phildunlap" aria-label="Profile: phildunlap">@<bdi>phildunlap</bdi></a> thank you for reply!<br />
I know that mango provides a completely superior function to UDP.<br />
But the reality is that an old system only accepts control signals in the form of UDP, and queries its database to determine whether the control effect has been achieved.</p>
<p dir="auto">my old system use these code(c#), if you need to skip:</p>
<pre><code>//your code here
private void opendoor(string DoorNumber)
        {
            string strDestinationIP = System.Configuration.ConfigurationSettings.AppSettings["DoorContoler"];
            string strMessage = string.Empty;
            if (DoorNumber.Equals("MainDoor"))
                strMessage = System.Configuration.ConfigurationSettings.AppSettings["MainDoorOpen"];           
            if (strMessage.Equals(string.Empty)) return;
            UdpClient udpClient = new UdpClient();
            IPAddress destinationIP = IPAddress.Parse(strDestinationIP);
            IPEndPoint destination = new IPEndPoint(destinationIP, 18001);
            byte[] message = HexStringToByteArray(strMessage);
            udpClient.Send(message, message.Length, destination);
            udpClient.Close();
        }
</code></pre>
]]></description><link>https://forum.mango-os.com/post/21786</link><guid isPermaLink="true">https://forum.mango-os.com/post/21786</guid><dc:creator><![CDATA[cuihe]]></dc:creator><pubDate>Wed, 10 Apr 2019 00:48:53 GMT</pubDate></item><item><title><![CDATA[Reply to is there have UDP in publisher? on Tue, 09 Apr 2019 17:31:02 GMT]]></title><description><![CDATA[<p dir="auto">Hi cuihe,</p>
<p dir="auto">You would be able to instantiate a java.net.DatagramSocket in a script, for the most general ability to use UDP. But with details of why may come a better answer, as Jared suggests.</p>
]]></description><link>https://forum.mango-os.com/post/21783</link><guid isPermaLink="true">https://forum.mango-os.com/post/21783</guid><dc:creator><![CDATA[phildunlap]]></dc:creator><pubDate>Tue, 09 Apr 2019 17:31:02 GMT</pubDate></item><item><title><![CDATA[Reply to is there have UDP in publisher? on Tue, 09 Apr 2019 15:26:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/cuihe" aria-label="Profile: cuihe">@<bdi>cuihe</bdi></a> said in <a href="/post/21776">is there have UDP in publisher?</a>:</p>
<blockquote>
<p dir="auto">I want to use UDP to send data out.</p>
</blockquote>
<p dir="auto">Why? Presumably there is a service that you are trying to interact with? We need more information than just 'UDP'.</p>
]]></description><link>https://forum.mango-os.com/post/21782</link><guid isPermaLink="true">https://forum.mango-os.com/post/21782</guid><dc:creator><![CDATA[Jared Wiltshire]]></dc:creator><pubDate>Tue, 09 Apr 2019 15:26:38 GMT</pubDate></item></channel></rss>