Previous topicNext topic
 XXXX Help
Help > Modules > communication module >

//socket communication process

1.configurecommu.xml

<?xml version="1.0" encoding="utf-8"?>

<commu>

    <type>socket</type>

    <ip>192.168.0.1</ip>

    <port>10000</port>

<timeout>60</timeout>

    <!-- whether to start SSL -->

    <ifSSL>0</ifSSL>

    <!-- certificate name,which should be put in ra w directory, ifnull is been set,all the certificate can be trusted -->

<cer>null</cer>

</commu>

 

此处配置的参数在通讯的时候将自动加载,如果有多个通讯地址,需要在每次通讯之前调用Commu.getInstence().setCommuParams(new CommuParams())进行设置

the parameters here will be auto loaded in the communication. If multiple communication addresses exist,Commu.getInstence().setCommuParams(new CommuParams()) should be called to configure the parameters before each communications.

Situation:

Description:

Void Onstatus(int,byte):communication status listener, byte will transefer the received data.

Void OnError(int,String):It is called when communication has error.