锘??xml version="1.0" encoding="utf-8" standalone="yes"?>成人影音在线,欧美亚洲免费,亚洲品质自拍视频http://www.aygfsteel.com/hellxoul/category/54044.htmlzh-cnThu, 12 Dec 2013 14:25:40 GMTThu, 12 Dec 2013 14:25:40 GMT60linux涓嬪疄鏂組QTThttp://www.aygfsteel.com/hellxoul/archive/2013/12/12/407513.htmlhellxoulhellxoulThu, 12 Dec 2013 13:54:00 GMThttp://www.aygfsteel.com/hellxoul/archive/2013/12/12/407513.htmlhttp://www.aygfsteel.com/hellxoul/comments/407513.htmlhttp://www.aygfsteel.com/hellxoul/archive/2013/12/12/407513.html#Feedback0http://www.aygfsteel.com/hellxoul/comments/commentRss/407513.htmlhttp://www.aygfsteel.com/hellxoul/services/trackbacks/407513.html

mosquito 鏄竴涓狹QTT 鏈嶅姟鍣ㄣ侻QTT鍗忚鍙敤鏉ュ仛Android娑堟伅鎺ㄩ侊紝鏈嶅姟鍣ㄧ閲囩敤mosquito+PhpMQTTClient(榪欎釜php鐢ㄦ潵鍋氬疄楠?

鑷繁涓嶄細java錛屼笉浼欰ndroid寮鍙戯紝鎺ㄩ佺殑寮鍙戦儴鍒嗘槸鍚屼簨鍋氱殑銆備嬌鐢ㄦ儏鍐佃〃鏄庯紝鍗曞彴鏈嶅姟鍣ㄨ兘婊¤凍鍑犱竾鐨勭ǔ瀹氱殑榪炴帴鏁幫紝鎵╁睍璧鋒潵涔熶笉闅撅紝鍔犳満鍣ㄥ嵆鍙?br />

涓嬭澆鏈鏂扮増鐨刴osquitto
cd /usr/local/src
wget http://mosquitto.org/files/source/mosquitto-1.1.2.tar.gz
tar zxvf mosquitto-1.1.2.tar.gz
cd mosquitto-1.1.2
濡傛灉褰撳墠openssl鐗堟湰浣庝簬1.0錛屼慨鏀筩onfig.mk涓殑WITH_TLS_PSK:=no
make
make install prefix=/usr/local/mosquitto
涓烘柟渚跨鐞嗭紝娣誨姞涓嬮潰鑷?etc/profile
export PATH=”$PATH:/usr/local/mosquitto/bin”
export PATH=”$PATH:/usr/local/mosquitto/sbin”

source /etc/profile
[root@mysql230 mosquitto]# mosquitto #tab琛ュ叏錛屽洓涓懡浠?br />mosquitto mosquitto_passwd mosquitto_pub mosquitto_sub

mosquitto鏈嶅姟鍣ㄤ富紼嬪簭錛屽疄鐜頒簡MQTT鍗忚
mosquitto_pub mosquitto鍙戝竷娑堟伅鐨勫懡浠よ紼嬪簭
mosquitto_sub mosquitto璁㈤槄娑堟伅鐨勫懡浠よ紼嬪簭
榛樿鐨勯厤緗枃浠跺湪 /etc/mosquitto/閲?/p>

灝?usr/local/mosquitto/lib/娣誨姞鑷?etc/ld.so.conf
鎵ц ldconfig -f /etc/ld.so.conf 鍙兘闇瑕佺瓑寰呮暟縐?/p>

鍚姩
mosquitto 錛?d鍚庡彴鍚姩錛?br />鍙兘鎻愮ず娌℃湁鐢ㄦ埛 mosquitto錛寀seradd mosquitto
緇堢嫻嬭瘯
瀹㈡埛绔?mosquitto_sub -h 192.168.1.230 -t test
鍙﹁搗鍛戒護琛宮osquitto_pub -t test -m ’123′
PhpMQTTClient瀹夎
鍘籬ttps://github.com/tokudu/PhpMQTTClient 涓嬭澆紼嬪簭鍖咃紝鏀劇疆鍒版湇鍔″櫒鐩綍
鍙兘闇瑕佺粨鍚堝疄闄呮儏鍐碉紝瑕佷慨鏀圭殑鍦版柟
index.php
$result = $conn->connect(SAM_MQTT, array(‘SAM_HOST’ => ’127.0.0.1′, ‘SAM_PORT’ => 1883));

SAM/MQTT/sam_mqtt.php
$this->port = 1883;

鍚姩mosquitto鍦ㄥ墠鍙拌繍琛岋紝浠ユ柟渚胯幏鍙栬繛鎺ュ鎴風(fēng)鐨勪俊鎭?br />mosquitto
鍦ㄦ湇鍔″櫒鍙﹀涓緇堢涓婂惎鍔ㄨ闃呮秷鎭殑榪涚▼錛岃闃呮墍鏈塼okudu寮澶磘opic
mosquitto_sub –t tokudu /+
娉ㄦ剰錛屾澶勪箣鎵浠ヨ浣跨敤tokudu錛屽彲浠ョ湅index.php鐨?82琛?var target = ‘tokudu/’ + $(‘#messageTarget’).val();
鍦╩osquitto鐨勭粓绔幏寰梞osquitto_sub瀹㈡埛绔殑id
1350006978: New client connected from 127.0.0.1 as mosqsub/8491-localhost..

璁塊棶http://host:port/ 錛宲ush notification target瀛楁濉啓8491-localhost錛宲ush notification text濉啓闇瑕佹帹閫佺殑嫻嬭瘯娑堟伅
鍦╩osquitto鐨勭粓绔煡鐪嬫槸鍚︽敹鍒頒簡鎺ㄩ佺殑娑堟伅錛屽鏋滄敹鍒幫紝璇存槑phpmqttclient宸茬粡瀹夎閰嶇疆鎴愬姛

瑙e喅mosquitto鍗犳湁cpu榪涚▼榪囬珮鐨勯棶棰?https://answers.launchpad.net/mosquitto/+question/189612
ulimit -u 4096
ulimit -n 4096

闄勶細
閰嶇疆鏂囦歡
# =================================================================
# General configuration
# =================================================================

# 瀹㈡埛绔績璺崇殑闂撮殧鏃墮棿
#retry_interval 20

# 緋葷粺鐘舵佺殑鍒鋒柊鏃墮棿
#sys_interval 10

# 緋葷粺璧勬簮鐨勫洖鏀舵椂闂達紝0琛ㄧず灝藉揩澶勭悊
#store_clean_interval 10

# 鏈嶅姟榪涚▼鐨凱ID
#pid_file /var/run/mosquitto.pid

# 鏈嶅姟榪涚▼鐨勭郴緇熺敤鎴?br />#user mosquitto

# 瀹㈡埛绔績璺蟲秷鎭殑鏈澶у茍鍙戞暟
#max_inflight_messages 10

# 瀹㈡埛绔績璺蟲秷鎭紦瀛橀槦鍒?br />#max_queued_messages 100

# 鐢ㄤ簬璁劇疆瀹㈡埛绔暱榪炴帴鐨勮繃鏈熸椂闂達紝榛樿姘鎬笉榪囨湡
#persistent_client_expiration

# =================================================================
# Default listener
# =================================================================

# 鏈嶅姟緇戝畾鐨処P鍦板潃
#bind_address

# 鏈嶅姟緇戝畾鐨勭鍙e彿
#port 1883

# 鍏佽鐨勬渶澶ц繛鎺ユ暟錛?1琛ㄧず娌℃湁闄愬埗
#max_connections -1

# cafile錛欳A璇佷功鏂囦歡
# capath錛欳A璇佷功鐩綍
# certfile錛歅EM璇佷功鏂囦歡
# keyfile錛歅EM瀵嗛挜鏂囦歡
#cafile
#capath
#certfile
#keyfile

# 蹇呴』鎻愪緵璇佷功浠ヤ繚璇佹暟鎹畨鍏ㄦ?br />#require_certificate false

# 鑻equire_certificate鍊間負true錛寀se_identity_as_username涔熷繀欏諱負true
#use_identity_as_username false

# 鍚敤PSK錛圥re-shared-key錛夋敮鎸?br />#psk_hint

# SSL/TSL鍔犲瘑綆楁硶錛屽彲浠ヤ嬌鐢?#8220;openssl ciphers”鍛戒護鑾峰彇
# as the output of that command.
#ciphers

# =================================================================
# Persistence
# =================================================================

# 娑堟伅鑷姩淇濆瓨鐨勯棿闅旀椂闂?br />#autosave_interval 1800

# 娑堟伅鑷姩淇濆瓨鍔熻兘鐨勫紑鍏?br />#autosave_on_changes false

# 鎸佷箙鍖栧姛鑳界殑寮鍏?br />persistence true

# 鎸佷箙鍖朌B鏂囦歡
#persistence_file mosquitto.db

# 鎸佷箙鍖朌B鏂囦歡鐩綍
#persistence_location /var/lib/mosquitto/

# =================================================================
# Logging
# =================================================================

# 4縐嶆棩蹇楁ā寮忥細stdout銆乻tderr銆乻yslog銆乼opic
# none 鍒欒〃紺轟笉璁版棩蹇楋紝姝ら厤緗彲浠ユ彁鍗囦簺璁告ц兘
log_dest none

# 閫夋嫨鏃ュ織鐨勭駭鍒紙鍙緗欏癸級
#log_type error
#log_type warning
#log_type notice
#log_type information

# 鏄惁璁板綍瀹㈡埛绔繛鎺ヤ俊鎭?br />#connection_messages true

# 鏄惁璁板綍鏃ュ織鏃墮棿
#log_timestamp true

# =================================================================
# Security
# =================================================================

# 瀹㈡埛绔疘D鐨勫墠緙闄愬埗錛屽彲鐢ㄤ簬淇濊瘉瀹夊叏鎬?br />#clientid_prefixes

# 鍏佽鍖垮悕鐢ㄦ埛
#allow_anonymous true

# 鐢ㄦ埛/瀵嗙爜鏂囦歡錛岄粯璁ゆ牸寮忥細username:password
#password_file

# PSK鏍煎紡瀵嗙爜鏂囦歡錛岄粯璁ゆ牸寮忥細identity:key
#psk_file

# pattern write sensor/%u/data
# ACL鏉冮檺閰嶇疆錛屽父鐢ㄨ娉曞涓嬶細
# 鐢ㄦ埛闄愬埗錛歶ser <username>
# 璇濋闄愬埗錛歵opic [read|write] <topic>
# 姝e垯闄愬埗錛歱attern write sensor/%u/data
#acl_file

# =================================================================
# Bridges
# =================================================================

# 鍏佽鏈嶅姟涔嬮棿浣跨敤“妗ユ帴”妯″紡錛堝彲鐢ㄤ簬鍒嗗竷寮忛儴緗詫級
#connection <name>
#address <host>[:<port>]
#topic <topic> [[[out | in | both] qos-level] local-prefix remote-prefix]

# 璁劇疆妗ユ帴鐨勫鎴風(fēng)ID
#clientid

# 妗ユ帴鏂紑鏃訛紝鏄惁娓呴櫎榪滅▼鏈嶅姟鍣ㄤ腑鐨勬秷鎭?br />#cleansession false

# 鏄惁鍙戝竷妗ユ帴鐨勭姸鎬佷俊鎭?br />#notifications true

# 璁劇疆妗ユ帴妯″紡涓嬶紝娑堟伅灝嗕細鍙戝竷鍒扮殑璇濋鍦板潃
# $SYS/broker/connection/<clientid>/state
#notification_topic

# 璁劇疆妗ユ帴鐨刱eepalive鏁板?br />#keepalive_interval 60

# 妗ユ帴妯″紡錛岀洰鍓嶆湁涓夌錛歛utomatic銆乴azy銆乷nce
#start_type automatic

# 妗ユ帴妯″紡automatic鐨勮秴鏃舵椂闂?br />#restart_timeout 30

# 妗ユ帴妯″紡lazy鐨勮秴鏃舵椂闂?br />#idle_timeout 60

# 妗ユ帴瀹㈡埛绔殑鐢ㄦ埛鍚?br />#username

# 妗ユ帴瀹㈡埛绔殑瀵嗙爜
#password

# bridge_cafile錛氭ˉ鎺ュ鎴風(fēng)鐨凜A璇佷功鏂囦歡
# bridge_capath錛氭ˉ鎺ュ鎴風(fēng)鐨凜A璇佷功鐩綍
# bridge_certfile錛氭ˉ鎺ュ鎴風(fēng)鐨凱EM璇佷功鏂囦歡
# bridge_keyfile錛氭ˉ鎺ュ鎴風(fēng)鐨凱EM瀵嗛挜鏂囦歡
#bridge_cafile
#bridge_capath
#bridge_certfile
#bridge_keyfile

# 鑷繁鐨勯厤緗彲浠ユ斁鍒頒互涓嬬洰褰曚腑
include_dir /etc/mosquitto/conf.d


鏈枃鍑鴻嚜 “Cooke Chen 鎴戠埍灝忚礉” 鍗氬錛岃鍔″繀淇濈暀姝ゅ嚭澶?a >http://cswei.blog.51cto.com/3443978/1225617



hellxoul 2013-12-12 21:54 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 邓州市| 西充县| 花垣县| 明星| 青田县| 新营市| 福州市| 神农架林区| 资兴市| 剑川县| 察隅县| 临夏县| 高青县| 静安区| 朔州市| 历史| 张掖市| 祁连县| 岗巴县| 皮山县| 新竹县| 江阴市| 吴旗县| 呈贡县| 乐陵市| 普陀区| 黑水县| 海南省| 大同县| 洪江市| 昭苏县| 绍兴县| 甘谷县| 和顺县| 石首市| 嘉峪关市| 正蓝旗| 肥东县| 佛冈县| 资中县| 都匀市|