Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/118.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用phonegap和ios的Udp混合应用程序_Ios_Html_Hybrid Mobile App - Fatal编程技术网

使用phonegap和ios的Udp混合应用程序

使用phonegap和ios的Udp混合应用程序,ios,html,hybrid-mobile-app,Ios,Html,Hybrid Mobile App,我已经将一个按钮集成到phonegap的ui中,我想向特定服务器发送udp命令,我该怎么做 html部分: <button id="sync" onclick="showToast1()" value="3C0055">sync</button> function showToast1(sender: AnyObject) { var byte:[UInt8] = [ 0x3c, 0x00, 0x55] v

我已经将一个按钮集成到phonegap的ui中,我想向特定服务器发送udp命令,我该怎么做

html部分:

<button id="sync" onclick="showToast1()" value="3C0055">sync</button>
function showToast1(sender: AnyObject) {
                var byte:[UInt8] = [ 0x3c, 0x00, 0x55]
                var data = NSData(bytes: byte, length: 5)
                mUdpSocket.sendData(data, toHost: "IP", port:"number", withTimeout: 2, tag: 0)

            }