0

I need to reply back to a response received.

How should I reply using the response?

I want to reply to a response received in my MDM System. The device contacts the server and delivers status as idle. Now I need to send a xml command directly to the device.

4

1 回答 1

0

您不能从 PHP Webserver 推送到 HTTPClient,HTTPClient 必须先与您联系(除非您编写套接字模块,否则 php 可能是错误的语言) - 只是说它,因为我不确定您想要实现什么。

无论如何直截了当-一旦设备与服务器联系并给出状态“空闲”,您就可以立即写出回显响应

if(isset($_POST['status']) && $_POST['status'] == 'idle') {
    echo '<?xml version="1.0" encoding="ISO-8859-1"?><root>
<data>blablabla</data>
    </root>';
}

等取决于设备实际联系服务器的方式,是否发送发布命令?它实际上是作为 HTTPClient 连接还是直接作为 TCP/IP 连接?你还有什么可以提供的信息吗?

于 2012-03-07T07:34:06.810 回答