資源簡介
python websocket server
javascript websocket client
代碼片段和文件信息
#coding:?utf-8
import?socket
import?base64
import?hashlib
import?struct
import?threading
class?websocket_thread(threading.Thread):
????def?__init__(self?connection):
????????super(websocket_thread?self).__init__()
????????self.connection?=?connection
????????print(“web_socket_thread?inited“)
????def?run(self):
????????while?True:
????????????try:
????????????????data?=?self.connection.recv(1024)
????????????????if?0?==?len(data):
????????????????????continue
????????????except?Exception?as?e:
????????????????print(“exception?:?“?+?str(e))
????????????????break
????????????print(data)
????????????data?=?self.parse_data(data)
????????????if?len(data)?==?0?:
????????????????continue
????????????#?message?=?self.username?+?“?:?“?+?data
????????????#?notif
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????6638??2017-08-22?22:03??Python_websocket_Proj\pythonServer.py
?????文件????????1184??2017-08-22?11:13??Python_websocket_Proj\websocketClient.html
?????目錄???????????0??2017-08-24?22:03??Python_websocket_Proj\
評論
共有 條評論