Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 229340

TCP sockets in ionic

$
0
0

you would use the receiveListener

(window).chrome.sockets.tcp.onReceive.addListener(recvListener) ;

var amountReceived = 0;
function recvListener(info)
{
amountReceived += info.data.byteLength;
var arr = new Uint8Array(info.data);
var textChunk = String.fromCharCode.apply(null,arr);
}

note that for large messages you might have multiple receives to get the whole message


Viewing all articles
Browse latest Browse all 229340

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>