0
Ожидает ответа пользователя

open tcp connection

Vuong Xuan Phuc 8 лет назад в Продукты / AV & Custom Systems обновлен Dmitry - support (expert) 8 лет назад 1

Hello everyone.


I have problem with AV& Custom driver (TCP).

My device need 2 kind of connection. It can be set when connect client to device.

So I wan't how to know open more connection to My device.

EX:
connect client to device.

Set kind of connection is 'send command'

open connection 2 connect client to device

set kind of connection 2 is ' get feedback'

thanks

Ожидает ответа пользователя

Hello!


You can try change the connection settings after the command is sent in the first connection.

To do this, use method IR.SetParameters.

For example:


IR.AddListener(IR.EVENT_ITEM_RELEASE,IR.GetItem("Page 1").GetItem("Item 1"),function()

{

IR.GetDevice("AV & Custom Systems (TCP)").Send(['getverion\r\n HTTP 1.1', '\r\n\r\n']);
IR.SetTimeout(50, function(){
IR.GetDevice('AV & Custom Systems (TCP)').SetParameters({Host: '192.168.0.10', Port: '80'});
});

})

In this example, when you press button the command being sent to the driver. Next, after 50 ms, the driver settings are changed. A delay of 50 ms is needed in order for the first command was sent to the driver and then changed the connection settings.

Сервис поддержки клиентов работает на платформе UserEcho