obniz to be used
Optional onconnectionCallback function is called when there is a change in TCP connection status.
// Javascript Example
var tcp = obniz.getFreeTcp();
tcp.onconnection = data => {
console.log(data);
};
tcp.connectWait(80,"obniz.io");
Optional onerrorYou can get the error message that occurred when connecting.
// Javascript Example
var tcp = obniz.getFreeTcp();
tcp.connectWait(80,"obniz.io");
tcp.onerror = state => {
console.log(state);
};
Optional onreceiveCallback function is called when TCP is received.
// Javascript Example
var tcp = obniz.getFreeTcp();
tcp.connectWait(80,"obniz.io");
tcp.onreceive = data => {
console.log(data);
};
Rsponse waiting timeout in milliseconds
Static prefixedThe argument data is sent by TCP.
If you pass a string or Array type argument, the data will be sent.
// Javascript Example
var tcp = obniz.getFreeTcp();
tcp.connectWait(80,"obniz.io");
// Array
tcp.write([0,1,2,3,4]);
// Text
tcp.write('hello');
Generated using TypeDoc
Create a TCP connection from a device throught the network the device is currently connected to.