0
Beantwoord

How to send data back to client with CUSTOM TCP SERVER

TuomoHautala 8 jaar geleden in Applications / i3 Pro bijgewerkt door Aleksandr Romanov (CTO) 8 jaar geleden 2

I have created CUSTOM_SERVER_TCP and we can connect with our clients to it.

Clients are sending data to server. (Example "GET ROOM TEPERATURE")

We can receive data with EVENT_RECEIVE_TEXT.

How can we send data back to client? (Example "ROOM TEPERATURE 24 °C")

+1

When you have something like this:

var MyTCPServer = IR.CreateDevice(IR.DEVICE_CUSTOM_SERVER_TCP, "MyTCPServer",  {Port: 3000,  MaxClients: 3});


just use the Send Method like

MyTCPServer.Send(['ROOM TEMPERATURE 24 °C',10,13]);